{"action":"created","comment":{"url":"https://api.github.com/repos/pydata/xarray/pulls/comments/51792787","id":51792787,"diff_hunk":"@@ -418,6 +418,9 @@ def _maybe_promote(dtype):\n         # convert to floating point so NaN is valid\n         dtype = float\n         fill_value = np.nan\n+    elif np.issubdtype(dtype, complex):\n+        #explicit cast of np.nan is probibly not necassary","path":"xarray/core/common.py","position":5,"original_position":5,"commit_id":"30eb7cfecf1110aa1b544e639544fba2a44fdad2","original_commit_id":"30eb7cfecf1110aa1b544e639544fba2a44fdad2","user":{"login":"shoyer","id":1217238,"avatar_url":"https://avatars.githubusercontent.com/u/1217238?v=3","gravatar_id":"","url":"https://api.github.com/users/shoyer","html_url":"https://github.com/shoyer","followers_url":"https://api.github.com/users/shoyer/followers","following_url":"https://api.github.com/users/shoyer/following{/other_user}","gists_url":"https://api.github.com/users/shoyer/gists{/gist_id}","starred_url":"https://api.github.com/users/shoyer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shoyer/subscriptions","organizations_url":"https://api.github.com/users/shoyer/orgs","repos_url":"https://api.github.com/users/shoyer/repos","events_url":"https://api.github.com/users/shoyer/events{/privacy}","received_events_url":"https://api.github.com/users/shoyer/received_events","type":"User","site_admin":false},"body":"This comment is no-longer relevant","created_at":"2016-02-03T21:48:33Z","updated_at":"2016-02-03T21:48:33Z","html_url":"https://github.com/pydata/xarray/pull/743#discussion_r51792787","pull_request_url":"https://api.github.com/repos/pydata/xarray/pulls/743","_links":{"self":{"href":"https://api.github.com/repos/pydata/xarray/pulls/comments/51792787"},"html":{"href":"https://github.com/pydata/xarray/pull/743#discussion_r51792787"},"pull_request":{"href":"https://api.github.com/repos/pydata/xarray/pulls/743"}}},"pull_request":{"url":"https://api.github.com/repos/pydata/xarray/pulls/743","id":58026866,"html_url":"https://github.com/pydata/xarray/pull/743","diff_url":"https://github.com/pydata/xarray/pull/743.diff","patch_url":"https://github.com/pydata/xarray/pull/743.patch","issue_url":"https://api.github.com/repos/pydata/xarray/issues/743","number":743,"state":"open","locked":false,"title":"BUG: reindexing an array with complex values should keep dtype=complex","user":{"login":"oceanEngineer","id":11950875,"avatar_url":"https://avatars.githubusercontent.com/u/11950875?v=3","gravatar_id":"","url":"https://api.github.com/users/oceanEngineer","html_url":"https://github.com/oceanEngineer","followers_url":"https://api.github.com/users/oceanEngineer/followers","following_url":"https://api.github.com/users/oceanEngineer/following{/other_user}","gists_url":"https://api.github.com/users/oceanEngineer/gists{/gist_id}","starred_url":"https://api.github.com/users/oceanEngineer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oceanEngineer/subscriptions","organizations_url":"https://api.github.com/users/oceanEngineer/orgs","repos_url":"https://api.github.com/users/oceanEngineer/repos","events_url":"https://api.github.com/users/oceanEngineer/events{/privacy}","received_events_url":"https://api.github.com/users/oceanEngineer/received_events","type":"User","site_admin":false},"body":"Fixes #738 \r\n\r\nI have added a simple behaviour for complex numbers in _maybe_promote. This fix means that  _maybe_promote does indeed return (dtype, np.nan + 0j) for complex dtypes, and the complex -> object conversion shown in #738 does not occur.","created_at":"2016-02-02T18:11:48Z","updated_at":"2016-02-03T21:48:33Z","closed_at":null,"merged_at":null,"merge_commit_sha":"de34366050874d479ac5714664d0d01598a3ed9b","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/pydata/xarray/pulls/743/commits","review_comments_url":"https://api.github.com/repos/pydata/xarray/pulls/743/comments","review_comment_url":"https://api.github.com/repos/pydata/xarray/pulls/comments{/number}","comments_url":"https://api.github.com/repos/pydata/xarray/issues/743/comments","statuses_url":"https://api.github.com/repos/pydata/xarray/statuses/30eb7cfecf1110aa1b544e639544fba2a44fdad2","head":{"label":"oceanEngineer:promote_wcomplex","ref":"promote_wcomplex","sha":"30eb7cfecf1110aa1b544e639544fba2a44fdad2","user":{"login":"oceanEngineer","id":11950875,"avatar_url":"https://avatars.githubusercontent.com/u/11950875?v=3","gravatar_id":"","url":"https://api.github.com/users/oceanEngineer","html_url":"https://github.com/oceanEngineer","followers_url":"https://api.github.com/users/oceanEngineer/followers","following_url":"https://api.github.com/users/oceanEngineer/following{/other_user}","gists_url":"https://api.github.com/users/oceanEngineer/gists{/gist_id}","starred_url":"https://api.github.com/users/oceanEngineer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oceanEngineer/subscriptions","organizations_url":"https://api.github.com/users/oceanEngineer/orgs","repos_url":"https://api.github.com/users/oceanEngineer/repos","events_url":"https://api.github.com/users/oceanEngineer/events{/privacy}","received_events_url":"https://api.github.com/users/oceanEngineer/received_events","type":"User","site_admin":false},"repo":{"id":50938972,"name":"xarray","full_name":"oceanEngineer/xarray","owner":{"login":"oceanEngineer","id":11950875,"avatar_url":"https://avatars.githubusercontent.com/u/11950875?v=3","gravatar_id":"","url":"https://api.github.com/users/oceanEngineer","html_url":"https://github.com/oceanEngineer","followers_url":"https://api.github.com/users/oceanEngineer/followers","following_url":"https://api.github.com/users/oceanEngineer/following{/other_user}","gists_url":"https://api.github.com/users/oceanEngineer/gists{/gist_id}","starred_url":"https://api.github.com/users/oceanEngineer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oceanEngineer/subscriptions","organizations_url":"https://api.github.com/users/oceanEngineer/orgs","repos_url":"https://api.github.com/users/oceanEngineer/repos","events_url":"https://api.github.com/users/oceanEngineer/events{/privacy}","received_events_url":"https://api.github.com/users/oceanEngineer/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/oceanEngineer/xarray","description":"N-D labeled arrays and datasets in Python","fork":true,"url":"https://api.github.com/repos/oceanEngineer/xarray","forks_url":"https://api.github.com/repos/oceanEngineer/xarray/forks","keys_url":"https://api.github.com/repos/oceanEngineer/xarray/keys{/key_id}","collaborators_url":"https://api.github.com/repos/oceanEngineer/xarray/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/oceanEngineer/xarray/teams","hooks_url":"https://api.github.com/repos/oceanEngineer/xarray/hooks","issue_events_url":"https://api.github.com/repos/oceanEngineer/xarray/issues/events{/number}","events_url":"https://api.github.com/repos/oceanEngineer/xarray/events","assignees_url":"https://api.github.com/repos/oceanEngineer/xarray/assignees{/user}","branches_url":"https://api.github.com/repos/oceanEngineer/xarray/branches{/branch}","tags_url":"https://api.github.com/repos/oceanEngineer/xarray/tags","blobs_url":"https://api.github.com/repos/oceanEngineer/xarray/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/oceanEngineer/xarray/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/oceanEngineer/xarray/git/refs{/sha}","trees_url":"https://api.github.com/repos/oceanEngineer/xarray/git/trees{/sha}","statuses_url":"https://api.github.com/repos/oceanEngineer/xarray/statuses/{sha}","languages_url":"https://api.github.com/repos/oceanEngineer/xarray/languages","stargazers_url":"https://api.github.com/repos/oceanEngineer/xarray/stargazers","contributors_url":"https://api.github.com/repos/oceanEngineer/xarray/contributors","subscribers_url":"https://api.github.com/repos/oceanEngineer/xarray/subscribers","subscription_url":"https://api.github.com/repos/oceanEngineer/xarray/subscription","commits_url":"https://api.github.com/repos/oceanEngineer/xarray/commits{/sha}","git_commits_url":"https://api.github.com/repos/oceanEngineer/xarray/git/commits{/sha}","comments_url":"https://api.github.com/repos/oceanEngineer/xarray/comments{/number}","issue_comment_url":"https://api.github.com/repos/oceanEngineer/xarray/issues/comments{/number}","contents_url":"https://api.github.com/repos/oceanEngineer/xarray/contents/{+path}","compare_url":"https://api.github.com/repos/oceanEngineer/xarray/compare/{base}...{head}","merges_url":"https://api.github.com/repos/oceanEngineer/xarray/merges","archive_url":"https://api.github.com/repos/oceanEngineer/xarray/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/oceanEngineer/xarray/downloads","issues_url":"https://api.github.com/repos/oceanEngineer/xarray/issues{/number}","pulls_url":"https://api.github.com/repos/oceanEngineer/xarray/pulls{/number}","milestones_url":"https://api.github.com/repos/oceanEngineer/xarray/milestones{/number}","notifications_url":"https://api.github.com/repos/oceanEngineer/xarray/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/oceanEngineer/xarray/labels{/name}","releases_url":"https://api.github.com/repos/oceanEngineer/xarray/releases{/id}","deployments_url":"https://api.github.com/repos/oceanEngineer/xarray/deployments","created_at":"2016-02-02T17:40:08Z","updated_at":"2016-02-02T17:40:09Z","pushed_at":"2016-02-03T21:44:49Z","git_url":"git://github.com/oceanEngineer/xarray.git","ssh_url":"git@github.com:oceanEngineer/xarray.git","clone_url":"https://github.com/oceanEngineer/xarray.git","svn_url":"https://github.com/oceanEngineer/xarray","homepage":"http://xarray.pydata.org","size":6052,"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":"master"}},"base":{"label":"pydata:master","ref":"master","sha":"0f77748721e5cc3dba977102d8576d134001f421","user":{"login":"pydata","id":1284191,"avatar_url":"https://avatars.githubusercontent.com/u/1284191?v=3","gravatar_id":"","url":"https://api.github.com/users/pydata","html_url":"https://github.com/pydata","followers_url":"https://api.github.com/users/pydata/followers","following_url":"https://api.github.com/users/pydata/following{/other_user}","gists_url":"https://api.github.com/users/pydata/gists{/gist_id}","starred_url":"https://api.github.com/users/pydata/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pydata/subscriptions","organizations_url":"https://api.github.com/users/pydata/orgs","repos_url":"https://api.github.com/users/pydata/repos","events_url":"https://api.github.com/users/pydata/events{/privacy}","received_events_url":"https://api.github.com/users/pydata/received_events","type":"Organization","site_admin":false},"repo":{"id":13221727,"name":"xarray","full_name":"pydata/xarray","owner":{"login":"pydata","id":1284191,"avatar_url":"https://avatars.githubusercontent.com/u/1284191?v=3","gravatar_id":"","url":"https://api.github.com/users/pydata","html_url":"https://github.com/pydata","followers_url":"https://api.github.com/users/pydata/followers","following_url":"https://api.github.com/users/pydata/following{/other_user}","gists_url":"https://api.github.com/users/pydata/gists{/gist_id}","starred_url":"https://api.github.com/users/pydata/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pydata/subscriptions","organizations_url":"https://api.github.com/users/pydata/orgs","repos_url":"https://api.github.com/users/pydata/repos","events_url":"https://api.github.com/users/pydata/events{/privacy}","received_events_url":"https://api.github.com/users/pydata/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/pydata/xarray","description":"N-D labeled arrays and datasets in Python","fork":false,"url":"https://api.github.com/repos/pydata/xarray","forks_url":"https://api.github.com/repos/pydata/xarray/forks","keys_url":"https://api.github.com/repos/pydata/xarray/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pydata/xarray/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pydata/xarray/teams","hooks_url":"https://api.github.com/repos/pydata/xarray/hooks","issue_events_url":"https://api.github.com/repos/pydata/xarray/issues/events{/number}","events_url":"https://api.github.com/repos/pydata/xarray/events","assignees_url":"https://api.github.com/repos/pydata/xarray/assignees{/user}","branches_url":"https://api.github.com/repos/pydata/xarray/branches{/branch}","tags_url":"https://api.github.com/repos/pydata/xarray/tags","blobs_url":"https://api.github.com/repos/pydata/xarray/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pydata/xarray/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pydata/xarray/git/refs{/sha}","trees_url":"https://api.github.com/repos/pydata/xarray/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pydata/xarray/statuses/{sha}","languages_url":"https://api.github.com/repos/pydata/xarray/languages","stargazers_url":"https://api.github.com/repos/pydata/xarray/stargazers","contributors_url":"https://api.github.com/repos/pydata/xarray/contributors","subscribers_url":"https://api.github.com/repos/pydata/xarray/subscribers","subscription_url":"https://api.github.com/repos/pydata/xarray/subscription","commits_url":"https://api.github.com/repos/pydata/xarray/commits{/sha}","git_commits_url":"https://api.github.com/repos/pydata/xarray/git/commits{/sha}","comments_url":"https://api.github.com/repos/pydata/xarray/comments{/number}","issue_comment_url":"https://api.github.com/repos/pydata/xarray/issues/comments{/number}","contents_url":"https://api.github.com/repos/pydata/xarray/contents/{+path}","compare_url":"https://api.github.com/repos/pydata/xarray/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pydata/xarray/merges","archive_url":"https://api.github.com/repos/pydata/xarray/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pydata/xarray/downloads","issues_url":"https://api.github.com/repos/pydata/xarray/issues{/number}","pulls_url":"https://api.github.com/repos/pydata/xarray/pulls{/number}","milestones_url":"https://api.github.com/repos/pydata/xarray/milestones{/number}","notifications_url":"https://api.github.com/repos/pydata/xarray/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pydata/xarray/labels{/name}","releases_url":"https://api.github.com/repos/pydata/xarray/releases{/id}","deployments_url":"https://api.github.com/repos/pydata/xarray/deployments","created_at":"2013-09-30T17:21:10Z","updated_at":"2016-02-03T06:22:45Z","pushed_at":"2016-02-03T21:44:49Z","git_url":"git://github.com/pydata/xarray.git","ssh_url":"git@github.com:pydata/xarray.git","clone_url":"https://github.com/pydata/xarray.git","svn_url":"https://github.com/pydata/xarray","homepage":"http://xarray.pydata.org","size":6288,"stargazers_count":330,"watchers_count":330,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":83,"mirror_url":null,"open_issues_count":127,"forks":83,"open_issues":127,"watchers":330,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/pydata/xarray/pulls/743"},"html":{"href":"https://github.com/pydata/xarray/pull/743"},"issue":{"href":"https://api.github.com/repos/pydata/xarray/issues/743"},"comments":{"href":"https://api.github.com/repos/pydata/xarray/issues/743/comments"},"review_comments":{"href":"https://api.github.com/repos/pydata/xarray/pulls/743/comments"},"review_comment":{"href":"https://api.github.com/repos/pydata/xarray/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/pydata/xarray/pulls/743/commits"},"statuses":{"href":"https://api.github.com/repos/pydata/xarray/statuses/30eb7cfecf1110aa1b544e639544fba2a44fdad2"}}}}