{"action":"created","comment":{"url":"https://api.github.com/repos/astropy/astropy/pulls/comments/170375344","pull_request_review_id":99061470,"id":170375344,"diff_hunk":"@@ -504,9 +504,16 @@ def shape(self):\n             model_axis = self._model._model_set_axis\n \n             if model_axis < 0:\n-                model_axis = len(shape) + model_axis\n+                model_axis = len(self._model) + model_axis\n \n-            shape = shape[:model_axis] + shape[model_axis + 1:]\n+            # When a model set is initialized, the dimension of the parameters\n+            # is increased by model_set_axis+1. To find the shape of a parameter\n+            # within a single model the extra dimensions need to be removed first.\n+            # The following dimension shows the number of models.\n+            # The rest of the shape tuple represents the shape of the parameter\n+            # in a single model.\n+\n+            shape = shape[model_axis + 1:]","path":"astropy/modeling/parameters.py","position":15,"original_position":15,"commit_id":"9ddb825a571c7aa4ccdfef718e2b9a32b27d06fc","original_commit_id":"9ddb825a571c7aa4ccdfef718e2b9a32b27d06fc","user":{"login":"nden","id":1110361,"avatar_url":"https://avatars2.githubusercontent.com/u/1110361?v=4","gravatar_id":"","url":"https://api.github.com/users/nden","html_url":"https://github.com/nden","followers_url":"https://api.github.com/users/nden/followers","following_url":"https://api.github.com/users/nden/following{/other_user}","gists_url":"https://api.github.com/users/nden/gists{/gist_id}","starred_url":"https://api.github.com/users/nden/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nden/subscriptions","organizations_url":"https://api.github.com/users/nden/orgs","repos_url":"https://api.github.com/users/nden/repos","events_url":"https://api.github.com/users/nden/events{/privacy}","received_events_url":"https://api.github.com/users/nden/received_events","type":"User","site_admin":false},"body":"For a Polynomial, though, the coefficients should always have shape (), regardless of model_set_axis, right? At least that's my interpretation.","created_at":"2018-02-23T21:42:06Z","updated_at":"2018-02-23T21:42:06Z","html_url":"https://github.com/astropy/astropy/pull/7222#discussion_r170375344","pull_request_url":"https://api.github.com/repos/astropy/astropy/pulls/7222","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/astropy/astropy/pulls/comments/170375344"},"html":{"href":"https://github.com/astropy/astropy/pull/7222#discussion_r170375344"},"pull_request":{"href":"https://api.github.com/repos/astropy/astropy/pulls/7222"}},"in_reply_to_id":170373435},"pull_request":{"url":"https://api.github.com/repos/astropy/astropy/pulls/7222","id":170550960,"html_url":"https://github.com/astropy/astropy/pull/7222","diff_url":"https://github.com/astropy/astropy/pull/7222.diff","patch_url":"https://github.com/astropy/astropy/pull/7222.patch","issue_url":"https://api.github.com/repos/astropy/astropy/issues/7222","number":7222,"state":"open","locked":false,"title":"evaluate model sets with model_set_axis=False","user":{"login":"nden","id":1110361,"avatar_url":"https://avatars2.githubusercontent.com/u/1110361?v=4","gravatar_id":"","url":"https://api.github.com/users/nden","html_url":"https://github.com/nden","followers_url":"https://api.github.com/users/nden/followers","following_url":"https://api.github.com/users/nden/following{/other_user}","gists_url":"https://api.github.com/users/nden/gists{/gist_id}","starred_url":"https://api.github.com/users/nden/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nden/subscriptions","organizations_url":"https://api.github.com/users/nden/orgs","repos_url":"https://api.github.com/users/nden/repos","events_url":"https://api.github.com/users/nden/events{/privacy}","received_events_url":"https://api.github.com/users/nden/received_events","type":"User","site_admin":false},"body":"Fixes #7159 - a model initialized with `model_set_axis > 0` can't be evaluated with `model_set_axis=False`.\r\n\r\nMy interpretation of the bug is that in this case what is reported by `Model.parameter.shape` for any parameter used in the initialization is not correct. There's some inconsistency between docstrings and [code](https://github.com/astropy/astropy/blob/master/astropy/modeling/parameters.py#L492) in this case, as the doc states that in this case the shape of the parameter is the shape it would have in a single model, however it returns something different (depending on the shape of the parameter value).\r\n\r\nIn addition `model_set_axis` was not passed to `prepare_outputs_model_set` which caused incorrect shape of the output.\r\n\r\n@jehturner @perrygreenfield \r\n\r\nDoes this seem like a reasonable solution? Do you see a better one?\r\nThere are other issues with model sets which I will address in a separate issue.\r\n","created_at":"2018-02-21T18:26:06Z","updated_at":"2018-02-23T21:42:06Z","closed_at":null,"merged_at":null,"merge_commit_sha":"26c54108359b4018ec76c9a3d25e9e74eff6d64a","assignee":null,"assignees":[],"requested_reviewers":[{"login":"perrygreenfield","id":981803,"avatar_url":"https://avatars0.githubusercontent.com/u/981803?v=4","gravatar_id":"","url":"https://api.github.com/users/perrygreenfield","html_url":"https://github.com/perrygreenfield","followers_url":"https://api.github.com/users/perrygreenfield/followers","following_url":"https://api.github.com/users/perrygreenfield/following{/other_user}","gists_url":"https://api.github.com/users/perrygreenfield/gists{/gist_id}","starred_url":"https://api.github.com/users/perrygreenfield/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/perrygreenfield/subscriptions","organizations_url":"https://api.github.com/users/perrygreenfield/orgs","repos_url":"https://api.github.com/users/perrygreenfield/repos","events_url":"https://api.github.com/users/perrygreenfield/events{/privacy}","received_events_url":"https://api.github.com/users/perrygreenfield/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[{"id":68702422,"url":"https://api.github.com/repos/astropy/astropy/labels/Affects-release","name":"Affects-release","color":"0052cc","default":false},{"id":16191481,"url":"https://api.github.com/repos/astropy/astropy/labels/Bug","name":"Bug","color":"d93f0b","default":false},{"id":373761720,"url":"https://api.github.com/repos/astropy/astropy/labels/Work%20in%20progress","name":"Work in progress","color":"f9d0c4","default":false},{"id":35800382,"url":"https://api.github.com/repos/astropy/astropy/labels/modeling","name":"modeling","color":"c7def8","default":false}],"milestone":{"url":"https://api.github.com/repos/astropy/astropy/milestones/54","html_url":"https://github.com/astropy/astropy/milestone/54","labels_url":"https://api.github.com/repos/astropy/astropy/milestones/54/labels","id":3037408,"number":54,"title":"v3.0.1","description":"","creator":{"login":"bsipocz","id":6788290,"avatar_url":"https://avatars1.githubusercontent.com/u/6788290?v=4","gravatar_id":"","url":"https://api.github.com/users/bsipocz","html_url":"https://github.com/bsipocz","followers_url":"https://api.github.com/users/bsipocz/followers","following_url":"https://api.github.com/users/bsipocz/following{/other_user}","gists_url":"https://api.github.com/users/bsipocz/gists{/gist_id}","starred_url":"https://api.github.com/users/bsipocz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bsipocz/subscriptions","organizations_url":"https://api.github.com/users/bsipocz/orgs","repos_url":"https://api.github.com/users/bsipocz/repos","events_url":"https://api.github.com/users/bsipocz/events{/privacy}","received_events_url":"https://api.github.com/users/bsipocz/received_events","type":"User","site_admin":false},"open_issues":9,"closed_issues":3,"state":"open","created_at":"2018-01-15T21:51:14Z","updated_at":"2018-02-23T13:50:04Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/astropy/astropy/pulls/7222/commits","review_comments_url":"https://api.github.com/repos/astropy/astropy/pulls/7222/comments","review_comment_url":"https://api.github.com/repos/astropy/astropy/pulls/comments{/number}","comments_url":"https://api.github.com/repos/astropy/astropy/issues/7222/comments","statuses_url":"https://api.github.com/repos/astropy/astropy/statuses/9ddb825a571c7aa4ccdfef718e2b9a32b27d06fc","head":{"label":"nden:model-set-axis-false","ref":"model-set-axis-false","sha":"9ddb825a571c7aa4ccdfef718e2b9a32b27d06fc","user":{"login":"nden","id":1110361,"avatar_url":"https://avatars2.githubusercontent.com/u/1110361?v=4","gravatar_id":"","url":"https://api.github.com/users/nden","html_url":"https://github.com/nden","followers_url":"https://api.github.com/users/nden/followers","following_url":"https://api.github.com/users/nden/following{/other_user}","gists_url":"https://api.github.com/users/nden/gists{/gist_id}","starred_url":"https://api.github.com/users/nden/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nden/subscriptions","organizations_url":"https://api.github.com/users/nden/orgs","repos_url":"https://api.github.com/users/nden/repos","events_url":"https://api.github.com/users/nden/events{/privacy}","received_events_url":"https://api.github.com/users/nden/received_events","type":"User","site_admin":false},"repo":{"id":6738136,"name":"astropy","full_name":"nden/astropy","owner":{"login":"nden","id":1110361,"avatar_url":"https://avatars2.githubusercontent.com/u/1110361?v=4","gravatar_id":"","url":"https://api.github.com/users/nden","html_url":"https://github.com/nden","followers_url":"https://api.github.com/users/nden/followers","following_url":"https://api.github.com/users/nden/following{/other_user}","gists_url":"https://api.github.com/users/nden/gists{/gist_id}","starred_url":"https://api.github.com/users/nden/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nden/subscriptions","organizations_url":"https://api.github.com/users/nden/orgs","repos_url":"https://api.github.com/users/nden/repos","events_url":"https://api.github.com/users/nden/events{/privacy}","received_events_url":"https://api.github.com/users/nden/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/nden/astropy","description":"Main AstroPy repository","fork":true,"url":"https://api.github.com/repos/nden/astropy","forks_url":"https://api.github.com/repos/nden/astropy/forks","keys_url":"https://api.github.com/repos/nden/astropy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nden/astropy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nden/astropy/teams","hooks_url":"https://api.github.com/repos/nden/astropy/hooks","issue_events_url":"https://api.github.com/repos/nden/astropy/issues/events{/number}","events_url":"https://api.github.com/repos/nden/astropy/events","assignees_url":"https://api.github.com/repos/nden/astropy/assignees{/user}","branches_url":"https://api.github.com/repos/nden/astropy/branches{/branch}","tags_url":"https://api.github.com/repos/nden/astropy/tags","blobs_url":"https://api.github.com/repos/nden/astropy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nden/astropy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nden/astropy/git/refs{/sha}","trees_url":"https://api.github.com/repos/nden/astropy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nden/astropy/statuses/{sha}","languages_url":"https://api.github.com/repos/nden/astropy/languages","stargazers_url":"https://api.github.com/repos/nden/astropy/stargazers","contributors_url":"https://api.github.com/repos/nden/astropy/contributors","subscribers_url":"https://api.github.com/repos/nden/astropy/subscribers","subscription_url":"https://api.github.com/repos/nden/astropy/subscription","commits_url":"https://api.github.com/repos/nden/astropy/commits{/sha}","git_commits_url":"https://api.github.com/repos/nden/astropy/git/commits{/sha}","comments_url":"https://api.github.com/repos/nden/astropy/comments{/number}","issue_comment_url":"https://api.github.com/repos/nden/astropy/issues/comments{/number}","contents_url":"https://api.github.com/repos/nden/astropy/contents/{+path}","compare_url":"https://api.github.com/repos/nden/astropy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nden/astropy/merges","archive_url":"https://api.github.com/repos/nden/astropy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nden/astropy/downloads","issues_url":"https://api.github.com/repos/nden/astropy/issues{/number}","pulls_url":"https://api.github.com/repos/nden/astropy/pulls{/number}","milestones_url":"https://api.github.com/repos/nden/astropy/milestones{/number}","notifications_url":"https://api.github.com/repos/nden/astropy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nden/astropy/labels{/name}","releases_url":"https://api.github.com/repos/nden/astropy/releases{/id}","deployments_url":"https://api.github.com/repos/nden/astropy/deployments","created_at":"2012-11-17T18:06:04Z","updated_at":"2015-04-21T09:44:25Z","pushed_at":"2018-02-23T20:44:57Z","git_url":"git://github.com/nden/astropy.git","ssh_url":"git@github.com:nden/astropy.git","clone_url":"https://github.com/nden/astropy.git","svn_url":"https://github.com/nden/astropy","homepage":"astropy.org","size":60644,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":null,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"astropy:master","ref":"master","sha":"e946822e226cd25d0dd950acaf37c132ff19b693","user":{"login":"astropy","id":847984,"avatar_url":"https://avatars0.githubusercontent.com/u/847984?v=4","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://avatars0.githubusercontent.com/u/847984?v=4","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":"2018-02-23T13:05:13Z","pushed_at":"2018-02-23T20:45:00Z","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":66949,"stargazers_count":1547,"watchers_count":1547,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":807,"mirror_url":null,"archived":false,"open_issues_count":848,"license":{"key":"bsd-3-clause","name":"BSD 3-Clause \"New\" or \"Revised\" License","spdx_id":"BSD-3-Clause","url":"https://api.github.com/licenses/bsd-3-clause"},"forks":807,"open_issues":848,"watchers":1547,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/astropy/astropy/pulls/7222"},"html":{"href":"https://github.com/astropy/astropy/pull/7222"},"issue":{"href":"https://api.github.com/repos/astropy/astropy/issues/7222"},"comments":{"href":"https://api.github.com/repos/astropy/astropy/issues/7222/comments"},"review_comments":{"href":"https://api.github.com/repos/astropy/astropy/pulls/7222/comments"},"review_comment":{"href":"https://api.github.com/repos/astropy/astropy/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/astropy/astropy/pulls/7222/commits"},"statuses":{"href":"https://api.github.com/repos/astropy/astropy/statuses/9ddb825a571c7aa4ccdfef718e2b9a32b27d06fc"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"nden"}}