{"action":"created","comment":{"url":"https://api.github.com/repos/astropy/astropy/pulls/comments/86699927","pull_request_review_id":7344515,"id":86699927,"diff_hunk":"@@ -2959,8 +2959,18 @@ def slice(self, view, numpy_order=True):\n                 else:\n                     wcs_new.wcs.crpix[wcs_index] -= iview.start\n \n-            nitems = len(builtins.range(self._naxis[wcs_index])[iview])\n-            wcs_new._naxis[wcs_index] = nitems\n+            try:\n+                # range requires integers but the other attributes can also\n+                # handle arbitary values, so this needs to be in a try/except.\n+                nitems = len(builtins.range(self._naxis[wcs_index])[iview])\n+            except TypeError as exc:\n+                if 'indices must be integers' not in str(exc):\n+                    raise\n+                warnings.warn(\"NAXIS{0} could not be updated because one or \"\n+                              \"multiple indices ('{1}') were not integral.\"\n+                              \"\".format(wcs_index, iview), AstropyUserWarning)","path":"astropy/wcs/wcs.py","position":15,"original_position":15,"commit_id":"fdf5f2204c5fb263dcdb53e21427e2eb756676a1","original_commit_id":"fdf5f2204c5fb263dcdb53e21427e2eb756676a1","user":{"login":"MSeifert04","id":14200878,"avatar_url":"https://avatars.githubusercontent.com/u/14200878?v=3","gravatar_id":"","url":"https://api.github.com/users/MSeifert04","html_url":"https://github.com/MSeifert04","followers_url":"https://api.github.com/users/MSeifert04/followers","following_url":"https://api.github.com/users/MSeifert04/following{/other_user}","gists_url":"https://api.github.com/users/MSeifert04/gists{/gist_id}","starred_url":"https://api.github.com/users/MSeifert04/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MSeifert04/subscriptions","organizations_url":"https://api.github.com/users/MSeifert04/orgs","repos_url":"https://api.github.com/users/MSeifert04/repos","events_url":"https://api.github.com/users/MSeifert04/events{/privacy}","received_events_url":"https://api.github.com/users/MSeifert04/received_events","type":"User","site_admin":false},"body":"@keflavich I agree in the long run - but it deserves a deprecation period. Even if it doesn't make sense to slice it with floats it was possible before. \r\n\r\nThe original fix is backported to 1.0.11 and in my opinion it's too harsh for a bugfix-release. Please correct me if I'm wrong.","created_at":"2016-11-06T23:40:30Z","updated_at":"2016-11-06T23:40:30Z","html_url":"https://github.com/astropy/astropy/pull/5455#discussion_r86699927","pull_request_url":"https://api.github.com/repos/astropy/astropy/pulls/5455","_links":{"self":{"href":"https://api.github.com/repos/astropy/astropy/pulls/comments/86699927"},"html":{"href":"https://github.com/astropy/astropy/pull/5455#discussion_r86699927"},"pull_request":{"href":"https://api.github.com/repos/astropy/astropy/pulls/5455"}}},"pull_request":{"url":"https://api.github.com/repos/astropy/astropy/pulls/5455","id":92081928,"html_url":"https://github.com/astropy/astropy/pull/5455","diff_url":"https://github.com/astropy/astropy/pull/5455.diff","patch_url":"https://github.com/astropy/astropy/pull/5455.patch","issue_url":"https://api.github.com/repos/astropy/astropy/issues/5455","number":5455,"state":"open","locked":false,"title":"Skip update of naxisj if the slice for dimension j contains non integers","user":{"login":"MSeifert04","id":14200878,"avatar_url":"https://avatars.githubusercontent.com/u/14200878?v=3","gravatar_id":"","url":"https://api.github.com/users/MSeifert04","html_url":"https://github.com/MSeifert04","followers_url":"https://api.github.com/users/MSeifert04/followers","following_url":"https://api.github.com/users/MSeifert04/following{/other_user}","gists_url":"https://api.github.com/users/MSeifert04/gists{/gist_id}","starred_url":"https://api.github.com/users/MSeifert04/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MSeifert04/subscriptions","organizations_url":"https://api.github.com/users/MSeifert04/orgs","repos_url":"https://api.github.com/users/MSeifert04/repos","events_url":"https://api.github.com/users/MSeifert04/events{/privacy}","received_events_url":"https://api.github.com/users/MSeifert04/received_events","type":"User","site_admin":false},"body":"This fixes another problem originating from #5411 (see https://github.com/astropy/astroquery/pull/771 and https://github.com/astropy/astroquery/pull/782). The `range`-object cannot be sliced with non-integral values. This PR doesn't fix that but it throws a Warning instead of a `TypeError` and just doesn't slice that dimension.\r\n\r\nI wasn't sure what would be best:\r\n\r\n- implicitly convert start/stop/step values from floats to integers.\r\n- raise a deprecation-warning that slicing requires integral start/stop/step in the future (the #5411 could be backported and we don't want API changes in bugfix releases) and remove the `except`-block for astropy 1.3, 2.0, 3.0 or later.\r\n- raise a Warning that slicing the `naxis` with non-integral start/stop/step is not possible and just keep the original naxis value for this dimension.\r\n\r\nI've implemented the last option because it doesn't restrict the current options but also provides an (annoying) Warning that something did not work instead of implicitly truncating/rounding the values.","created_at":"2016-11-03T00:40:50Z","updated_at":"2016-11-06T23:40:30Z","closed_at":null,"merged_at":null,"merge_commit_sha":"cd697c8c8cfa0a7e3eeda8489ec8a2349d9a37d0","assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/astropy/astropy/milestones/40","html_url":"https://github.com/astropy/astropy/milestones/v1.0.11","labels_url":"https://api.github.com/repos/astropy/astropy/milestones/40/labels","id":1819335,"number":40,"title":"v1.0.11","description":null,"creator":{"login":"astrofrog","id":314716,"avatar_url":"https://avatars.githubusercontent.com/u/314716?v=3","gravatar_id":"","url":"https://api.github.com/users/astrofrog","html_url":"https://github.com/astrofrog","followers_url":"https://api.github.com/users/astrofrog/followers","following_url":"https://api.github.com/users/astrofrog/following{/other_user}","gists_url":"https://api.github.com/users/astrofrog/gists{/gist_id}","starred_url":"https://api.github.com/users/astrofrog/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/astrofrog/subscriptions","organizations_url":"https://api.github.com/users/astrofrog/orgs","repos_url":"https://api.github.com/users/astrofrog/repos","events_url":"https://api.github.com/users/astrofrog/events{/privacy}","received_events_url":"https://api.github.com/users/astrofrog/received_events","type":"User","site_admin":false},"open_issues":7,"closed_issues":32,"state":"open","created_at":"2016-06-10T06:42:23Z","updated_at":"2016-11-06T12:58:13Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/astropy/astropy/pulls/5455/commits","review_comments_url":"https://api.github.com/repos/astropy/astropy/pulls/5455/comments","review_comment_url":"https://api.github.com/repos/astropy/astropy/pulls/comments{/number}","comments_url":"https://api.github.com/repos/astropy/astropy/issues/5455/comments","statuses_url":"https://api.github.com/repos/astropy/astropy/statuses/fdf5f2204c5fb263dcdb53e21427e2eb756676a1","head":{"label":"MSeifert04:wcs_skip_naxis_update_nonintegral","ref":"wcs_skip_naxis_update_nonintegral","sha":"fdf5f2204c5fb263dcdb53e21427e2eb756676a1","user":{"login":"MSeifert04","id":14200878,"avatar_url":"https://avatars.githubusercontent.com/u/14200878?v=3","gravatar_id":"","url":"https://api.github.com/users/MSeifert04","html_url":"https://github.com/MSeifert04","followers_url":"https://api.github.com/users/MSeifert04/followers","following_url":"https://api.github.com/users/MSeifert04/following{/other_user}","gists_url":"https://api.github.com/users/MSeifert04/gists{/gist_id}","starred_url":"https://api.github.com/users/MSeifert04/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MSeifert04/subscriptions","organizations_url":"https://api.github.com/users/MSeifert04/orgs","repos_url":"https://api.github.com/users/MSeifert04/repos","events_url":"https://api.github.com/users/MSeifert04/events{/privacy}","received_events_url":"https://api.github.com/users/MSeifert04/received_events","type":"User","site_admin":false},"repo":{"id":42801766,"name":"astropy","full_name":"MSeifert04/astropy","owner":{"login":"MSeifert04","id":14200878,"avatar_url":"https://avatars.githubusercontent.com/u/14200878?v=3","gravatar_id":"","url":"https://api.github.com/users/MSeifert04","html_url":"https://github.com/MSeifert04","followers_url":"https://api.github.com/users/MSeifert04/followers","following_url":"https://api.github.com/users/MSeifert04/following{/other_user}","gists_url":"https://api.github.com/users/MSeifert04/gists{/gist_id}","starred_url":"https://api.github.com/users/MSeifert04/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MSeifert04/subscriptions","organizations_url":"https://api.github.com/users/MSeifert04/orgs","repos_url":"https://api.github.com/users/MSeifert04/repos","events_url":"https://api.github.com/users/MSeifert04/events{/privacy}","received_events_url":"https://api.github.com/users/MSeifert04/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/MSeifert04/astropy","description":"Repository for the Astropy core package","fork":true,"url":"https://api.github.com/repos/MSeifert04/astropy","forks_url":"https://api.github.com/repos/MSeifert04/astropy/forks","keys_url":"https://api.github.com/repos/MSeifert04/astropy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/MSeifert04/astropy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/MSeifert04/astropy/teams","hooks_url":"https://api.github.com/repos/MSeifert04/astropy/hooks","issue_events_url":"https://api.github.com/repos/MSeifert04/astropy/issues/events{/number}","events_url":"https://api.github.com/repos/MSeifert04/astropy/events","assignees_url":"https://api.github.com/repos/MSeifert04/astropy/assignees{/user}","branches_url":"https://api.github.com/repos/MSeifert04/astropy/branches{/branch}","tags_url":"https://api.github.com/repos/MSeifert04/astropy/tags","blobs_url":"https://api.github.com/repos/MSeifert04/astropy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/MSeifert04/astropy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/MSeifert04/astropy/git/refs{/sha}","trees_url":"https://api.github.com/repos/MSeifert04/astropy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/MSeifert04/astropy/statuses/{sha}","languages_url":"https://api.github.com/repos/MSeifert04/astropy/languages","stargazers_url":"https://api.github.com/repos/MSeifert04/astropy/stargazers","contributors_url":"https://api.github.com/repos/MSeifert04/astropy/contributors","subscribers_url":"https://api.github.com/repos/MSeifert04/astropy/subscribers","subscription_url":"https://api.github.com/repos/MSeifert04/astropy/subscription","commits_url":"https://api.github.com/repos/MSeifert04/astropy/commits{/sha}","git_commits_url":"https://api.github.com/repos/MSeifert04/astropy/git/commits{/sha}","comments_url":"https://api.github.com/repos/MSeifert04/astropy/comments{/number}","issue_comment_url":"https://api.github.com/repos/MSeifert04/astropy/issues/comments{/number}","contents_url":"https://api.github.com/repos/MSeifert04/astropy/contents/{+path}","compare_url":"https://api.github.com/repos/MSeifert04/astropy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/MSeifert04/astropy/merges","archive_url":"https://api.github.com/repos/MSeifert04/astropy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/MSeifert04/astropy/downloads","issues_url":"https://api.github.com/repos/MSeifert04/astropy/issues{/number}","pulls_url":"https://api.github.com/repos/MSeifert04/astropy/pulls{/number}","milestones_url":"https://api.github.com/repos/MSeifert04/astropy/milestones{/number}","notifications_url":"https://api.github.com/repos/MSeifert04/astropy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/MSeifert04/astropy/labels{/name}","releases_url":"https://api.github.com/repos/MSeifert04/astropy/releases{/id}","deployments_url":"https://api.github.com/repos/MSeifert04/astropy/deployments","created_at":"2015-09-20T05:43:07Z","updated_at":"2016-04-12T23:47:32Z","pushed_at":"2016-11-06T14:43:50Z","git_url":"git://github.com/MSeifert04/astropy.git","ssh_url":"git@github.com:MSeifert04/astropy.git","clone_url":"https://github.com/MSeifert04/astropy.git","svn_url":"https://github.com/MSeifert04/astropy","homepage":"www.astropy.org","size":47064,"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":"astropy:master","ref":"master","sha":"dde01614cfbf95a98558e90de69d562b7f6fb3fb","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}","deployments_url":"https://api.github.com/repos/astropy/astropy/deployments","created_at":"2011-07-21T01:33:49Z","updated_at":"2016-11-05T22:35:16Z","pushed_at":"2016-11-06T22:20:11Z","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":69564,"stargazers_count":1020,"watchers_count":1020,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":606,"mirror_url":null,"open_issues_count":802,"forks":606,"open_issues":802,"watchers":1020,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/astropy/astropy/pulls/5455"},"html":{"href":"https://github.com/astropy/astropy/pull/5455"},"issue":{"href":"https://api.github.com/repos/astropy/astropy/issues/5455"},"comments":{"href":"https://api.github.com/repos/astropy/astropy/issues/5455/comments"},"review_comments":{"href":"https://api.github.com/repos/astropy/astropy/pulls/5455/comments"},"review_comment":{"href":"https://api.github.com/repos/astropy/astropy/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/astropy/astropy/pulls/5455/commits"},"statuses":{"href":"https://api.github.com/repos/astropy/astropy/statuses/fdf5f2204c5fb263dcdb53e21427e2eb756676a1"}}}}
{"actor":{"display_login":"MSeifert04"}}