{"action":"opened","number":3899,"pull_request":{"url":"https://api.github.com/repos/astropy/astropy/pulls/3899","id":38785462,"html_url":"https://github.com/astropy/astropy/pull/3899","diff_url":"https://github.com/astropy/astropy/pull/3899.diff","patch_url":"https://github.com/astropy/astropy/pull/3899.patch","issue_url":"https://api.github.com/repos/astropy/astropy/issues/3899","number":3899,"state":"open","locked":false,"title":"Simplify Quantity.isscalar","user":{"login":"mhvk","id":2789820,"avatar_url":"https://avatars.githubusercontent.com/u/2789820?v=3","gravatar_id":"","url":"https://api.github.com/users/mhvk","html_url":"https://github.com/mhvk","followers_url":"https://api.github.com/users/mhvk/followers","following_url":"https://api.github.com/users/mhvk/following{/other_user}","gists_url":"https://api.github.com/users/mhvk/gists{/gist_id}","starred_url":"https://api.github.com/users/mhvk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mhvk/subscriptions","organizations_url":"https://api.github.com/users/mhvk/orgs","repos_url":"https://api.github.com/users/mhvk/repos","events_url":"https://api.github.com/users/mhvk/events{/privacy}","received_events_url":"https://api.github.com/users/mhvk/received_events","type":"User","site_admin":false},"body":"Currently, `Quantity` checks whether it is a scalar by trying to iterate itself. This PR changes it to more simply look for it having no shape (or ndim=0). The only impact is that single-item quantities with structured `dtype` will now have `q.isscalar` return `True`.","created_at":"2015-06-29T15:26:46Z","updated_at":"2015-06-29T15:26:46Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/astropy/astropy/pulls/3899/commits","review_comments_url":"https://api.github.com/repos/astropy/astropy/pulls/3899/comments","review_comment_url":"https://api.github.com/repos/astropy/astropy/pulls/comments{/number}","comments_url":"https://api.github.com/repos/astropy/astropy/issues/3899/comments","statuses_url":"https://api.github.com/repos/astropy/astropy/statuses/f5300f26d61ab1ec76b75b215c0207ee8e0c528c","head":{"label":"mhvk:quantity-isscalar-simplification","ref":"quantity-isscalar-simplification","sha":"f5300f26d61ab1ec76b75b215c0207ee8e0c528c","user":{"login":"mhvk","id":2789820,"avatar_url":"https://avatars.githubusercontent.com/u/2789820?v=3","gravatar_id":"","url":"https://api.github.com/users/mhvk","html_url":"https://github.com/mhvk","followers_url":"https://api.github.com/users/mhvk/followers","following_url":"https://api.github.com/users/mhvk/following{/other_user}","gists_url":"https://api.github.com/users/mhvk/gists{/gist_id}","starred_url":"https://api.github.com/users/mhvk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mhvk/subscriptions","organizations_url":"https://api.github.com/users/mhvk/orgs","repos_url":"https://api.github.com/users/mhvk/repos","events_url":"https://api.github.com/users/mhvk/events{/privacy}","received_events_url":"https://api.github.com/users/mhvk/received_events","type":"User","site_admin":false},"repo":{"id":9993739,"name":"astropy","full_name":"mhvk/astropy","owner":{"login":"mhvk","id":2789820,"avatar_url":"https://avatars.githubusercontent.com/u/2789820?v=3","gravatar_id":"","url":"https://api.github.com/users/mhvk","html_url":"https://github.com/mhvk","followers_url":"https://api.github.com/users/mhvk/followers","following_url":"https://api.github.com/users/mhvk/following{/other_user}","gists_url":"https://api.github.com/users/mhvk/gists{/gist_id}","starred_url":"https://api.github.com/users/mhvk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mhvk/subscriptions","organizations_url":"https://api.github.com/users/mhvk/orgs","repos_url":"https://api.github.com/users/mhvk/repos","events_url":"https://api.github.com/users/mhvk/events{/privacy}","received_events_url":"https://api.github.com/users/mhvk/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mhvk/astropy","description":"Main AstroPy repository","fork":true,"url":"https://api.github.com/repos/mhvk/astropy","forks_url":"https://api.github.com/repos/mhvk/astropy/forks","keys_url":"https://api.github.com/repos/mhvk/astropy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mhvk/astropy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mhvk/astropy/teams","hooks_url":"https://api.github.com/repos/mhvk/astropy/hooks","issue_events_url":"https://api.github.com/repos/mhvk/astropy/issues/events{/number}","events_url":"https://api.github.com/repos/mhvk/astropy/events","assignees_url":"https://api.github.com/repos/mhvk/astropy/assignees{/user}","branches_url":"https://api.github.com/repos/mhvk/astropy/branches{/branch}","tags_url":"https://api.github.com/repos/mhvk/astropy/tags","blobs_url":"https://api.github.com/repos/mhvk/astropy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mhvk/astropy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mhvk/astropy/git/refs{/sha}","trees_url":"https://api.github.com/repos/mhvk/astropy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mhvk/astropy/statuses/{sha}","languages_url":"https://api.github.com/repos/mhvk/astropy/languages","stargazers_url":"https://api.github.com/repos/mhvk/astropy/stargazers","contributors_url":"https://api.github.com/repos/mhvk/astropy/contributors","subscribers_url":"https://api.github.com/repos/mhvk/astropy/subscribers","subscription_url":"https://api.github.com/repos/mhvk/astropy/subscription","commits_url":"https://api.github.com/repos/mhvk/astropy/commits{/sha}","git_commits_url":"https://api.github.com/repos/mhvk/astropy/git/commits{/sha}","comments_url":"https://api.github.com/repos/mhvk/astropy/comments{/number}","issue_comment_url":"https://api.github.com/repos/mhvk/astropy/issues/comments{/number}","contents_url":"https://api.github.com/repos/mhvk/astropy/contents/{+path}","compare_url":"https://api.github.com/repos/mhvk/astropy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mhvk/astropy/merges","archive_url":"https://api.github.com/repos/mhvk/astropy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mhvk/astropy/downloads","issues_url":"https://api.github.com/repos/mhvk/astropy/issues{/number}","pulls_url":"https://api.github.com/repos/mhvk/astropy/pulls{/number}","milestones_url":"https://api.github.com/repos/mhvk/astropy/milestones{/number}","notifications_url":"https://api.github.com/repos/mhvk/astropy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mhvk/astropy/labels{/name}","releases_url":"https://api.github.com/repos/mhvk/astropy/releases{/id}","created_at":"2013-05-11T02:02:37Z","updated_at":"2015-03-31T19:47:42Z","pushed_at":"2015-06-29T15:25:21Z","git_url":"git://github.com/mhvk/astropy.git","ssh_url":"git@github.com:mhvk/astropy.git","clone_url":"https://github.com/mhvk/astropy.git","svn_url":"https://github.com/mhvk/astropy","homepage":"astropy.org","size":38127,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"placeholder"}},"base":{"label":"astropy:master","ref":"master","sha":"b41d6bf612cd1847c672eb613ae2b4b716055232","user":{"login":"astropy","id":847984,"avatar_url":"https://avatars.githubusercontent.com/u/847984?v=3","gravatar_id":"","url":"https://api.github.com/users/astropy","html_url":"https://github.com/astropy","followers_url":"https://api.github.com/users/astropy/followers","following_url":"https://api.github.com/users/astropy/following{/other_user}","gists_url":"https://api.github.com/users/astropy/gists{/gist_id}","starred_url":"https://api.github.com/users/astropy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/astropy/subscriptions","organizations_url":"https://api.github.com/users/astropy/orgs","repos_url":"https://api.github.com/users/astropy/repos","events_url":"https://api.github.com/users/astropy/events{/privacy}","received_events_url":"https://api.github.com/users/astropy/received_events","type":"Organization","site_admin":false},"repo":{"id":2081289,"name":"astropy","full_name":"astropy/astropy","owner":{"login":"astropy","id":847984,"avatar_url":"https://avatars.githubusercontent.com/u/847984?v=3","gravatar_id":"","url":"https://api.github.com/users/astropy","html_url":"https://github.com/astropy","followers_url":"https://api.github.com/users/astropy/followers","following_url":"https://api.github.com/users/astropy/following{/other_user}","gists_url":"https://api.github.com/users/astropy/gists{/gist_id}","starred_url":"https://api.github.com/users/astropy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/astropy/subscriptions","organizations_url":"https://api.github.com/users/astropy/orgs","repos_url":"https://api.github.com/users/astropy/repos","events_url":"https://api.github.com/users/astropy/events{/privacy}","received_events_url":"https://api.github.com/users/astropy/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/astropy/astropy","description":"Repository for the Astropy core package","fork":false,"url":"https://api.github.com/repos/astropy/astropy","forks_url":"https://api.github.com/repos/astropy/astropy/forks","keys_url":"https://api.github.com/repos/astropy/astropy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/astropy/astropy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/astropy/astropy/teams","hooks_url":"https://api.github.com/repos/astropy/astropy/hooks","issue_events_url":"https://api.github.com/repos/astropy/astropy/issues/events{/number}","events_url":"https://api.github.com/repos/astropy/astropy/events","assignees_url":"https://api.github.com/repos/astropy/astropy/assignees{/user}","branches_url":"https://api.github.com/repos/astropy/astropy/branches{/branch}","tags_url":"https://api.github.com/repos/astropy/astropy/tags","blobs_url":"https://api.github.com/repos/astropy/astropy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/astropy/astropy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/astropy/astropy/git/refs{/sha}","trees_url":"https://api.github.com/repos/astropy/astropy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/astropy/astropy/statuses/{sha}","languages_url":"https://api.github.com/repos/astropy/astropy/languages","stargazers_url":"https://api.github.com/repos/astropy/astropy/stargazers","contributors_url":"https://api.github.com/repos/astropy/astropy/contributors","subscribers_url":"https://api.github.com/repos/astropy/astropy/subscribers","subscription_url":"https://api.github.com/repos/astropy/astropy/subscription","commits_url":"https://api.github.com/repos/astropy/astropy/commits{/sha}","git_commits_url":"https://api.github.com/repos/astropy/astropy/git/commits{/sha}","comments_url":"https://api.github.com/repos/astropy/astropy/comments{/number}","issue_comment_url":"https://api.github.com/repos/astropy/astropy/issues/comments{/number}","contents_url":"https://api.github.com/repos/astropy/astropy/contents/{+path}","compare_url":"https://api.github.com/repos/astropy/astropy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/astropy/astropy/merges","archive_url":"https://api.github.com/repos/astropy/astropy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/astropy/astropy/downloads","issues_url":"https://api.github.com/repos/astropy/astropy/issues{/number}","pulls_url":"https://api.github.com/repos/astropy/astropy/pulls{/number}","milestones_url":"https://api.github.com/repos/astropy/astropy/milestones{/number}","notifications_url":"https://api.github.com/repos/astropy/astropy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/astropy/astropy/labels{/name}","releases_url":"https://api.github.com/repos/astropy/astropy/releases{/id}","created_at":"2011-07-21T01:33:49Z","updated_at":"2015-06-28T19:39:52Z","pushed_at":"2015-06-29T12:25:33Z","git_url":"git://github.com/astropy/astropy.git","ssh_url":"git@github.com:astropy/astropy.git","clone_url":"https://github.com/astropy/astropy.git","svn_url":"https://github.com/astropy/astropy","homepage":"www.astropy.org","size":62217,"stargazers_count":595,"watchers_count":595,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":403,"mirror_url":null,"open_issues_count":557,"forks":403,"open_issues":557,"watchers":595,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/astropy/astropy/pulls/3899"},"html":{"href":"https://github.com/astropy/astropy/pull/3899"},"issue":{"href":"https://api.github.com/repos/astropy/astropy/issues/3899"},"comments":{"href":"https://api.github.com/repos/astropy/astropy/issues/3899/comments"},"review_comments":{"href":"https://api.github.com/repos/astropy/astropy/pulls/3899/comments"},"review_comment":{"href":"https://api.github.com/repos/astropy/astropy/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/astropy/astropy/pulls/3899/commits"},"statuses":{"href":"https://api.github.com/repos/astropy/astropy/statuses/f5300f26d61ab1ec76b75b215c0207ee8e0c528c"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":7,"deletions":7,"changed_files":3}}