{"action":"created","issue":{"url":"https://api.github.com/repos/astropy/astropy/issues/4656","repository_url":"https://api.github.com/repos/astropy/astropy","labels_url":"https://api.github.com/repos/astropy/astropy/issues/4656/labels{/name}","comments_url":"https://api.github.com/repos/astropy/astropy/issues/4656/comments","events_url":"https://api.github.com/repos/astropy/astropy/issues/4656/events","html_url":"https://github.com/astropy/astropy/pull/4656","id":137669812,"number":4656,"title":"Fix a bug in modeling.parameters affecting setters with 2 parameters","user":{"login":"mcara","id":5985250,"avatar_url":"https://avatars.githubusercontent.com/u/5985250?v=3","gravatar_id":"","url":"https://api.github.com/users/mcara","html_url":"https://github.com/mcara","followers_url":"https://api.github.com/users/mcara/followers","following_url":"https://api.github.com/users/mcara/following{/other_user}","gists_url":"https://api.github.com/users/mcara/gists{/gist_id}","starred_url":"https://api.github.com/users/mcara/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mcara/subscriptions","organizations_url":"https://api.github.com/users/mcara/orgs","repos_url":"https://api.github.com/users/mcara/repos","events_url":"https://api.github.com/users/mcara/events{/privacy}","received_events_url":"https://api.github.com/users/mcara/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/astropy/astropy/labels/Affects-release","name":"Affects-release","color":"0052cc"},{"url":"https://api.github.com/repos/astropy/astropy/labels/Bug","name":"Bug","color":"eb6420"},{"url":"https://api.github.com/repos/astropy/astropy/labels/modeling","name":"modeling","color":"c7def8"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/astropy/astropy/milestones/34","html_url":"https://github.com/astropy/astropy/milestones/v1.0.9","labels_url":"https://api.github.com/repos/astropy/astropy/milestones/34/labels","id":1490288,"number":34,"title":"v1.0.9","description":"","creator":{"login":"embray","id":676149,"avatar_url":"https://avatars.githubusercontent.com/u/676149?v=3","gravatar_id":"","url":"https://api.github.com/users/embray","html_url":"https://github.com/embray","followers_url":"https://api.github.com/users/embray/followers","following_url":"https://api.github.com/users/embray/following{/other_user}","gists_url":"https://api.github.com/users/embray/gists{/gist_id}","starred_url":"https://api.github.com/users/embray/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/embray/subscriptions","organizations_url":"https://api.github.com/users/embray/orgs","repos_url":"https://api.github.com/users/embray/repos","events_url":"https://api.github.com/users/embray/events{/privacy}","received_events_url":"https://api.github.com/users/embray/received_events","type":"User","site_admin":false},"open_issues":12,"closed_issues":27,"state":"open","created_at":"2016-01-07T20:15:39Z","updated_at":"2016-03-02T21:09:38Z","due_on":null,"closed_at":null},"comments":11,"created_at":"2016-03-01T19:52:39Z","updated_at":"2016-03-03T15:59:57Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/astropy/astropy/pulls/4656","html_url":"https://github.com/astropy/astropy/pull/4656","diff_url":"https://github.com/astropy/astropy/pull/4656.diff","patch_url":"https://github.com/astropy/astropy/pull/4656.patch"},"body":"Fixes a bug in modeling.parameters.Parameter due to which instantiation\nof a model class with custom setters having two parameters (expecting\nsecond parameter to be the model object) would fail. See issue #4586\nfor more details."},"comment":{"url":"https://api.github.com/repos/astropy/astropy/issues/comments/191826575","html_url":"https://github.com/astropy/astropy/pull/4656#issuecomment-191826575","issue_url":"https://api.github.com/repos/astropy/astropy/issues/4656","id":191826575,"user":{"login":"pllim","id":2090236,"avatar_url":"https://avatars.githubusercontent.com/u/2090236?v=3","gravatar_id":"","url":"https://api.github.com/users/pllim","html_url":"https://github.com/pllim","followers_url":"https://api.github.com/users/pllim/followers","following_url":"https://api.github.com/users/pllim/following{/other_user}","gists_url":"https://api.github.com/users/pllim/gists{/gist_id}","starred_url":"https://api.github.com/users/pllim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pllim/subscriptions","organizations_url":"https://api.github.com/users/pllim/orgs","repos_url":"https://api.github.com/users/pllim/repos","events_url":"https://api.github.com/users/pllim/events{/privacy}","received_events_url":"https://api.github.com/users/pllim/received_events","type":"User","site_admin":false},"created_at":"2016-03-03T15:59:57Z","updated_at":"2016-03-03T15:59:57Z","body":"Maybe adding a test wasn't a bad idea after all (I stand corrected!). Something is not quite right still. If you look in Travis log, it complains about this, which I can reproduce locally using this PR:\r\n```python\r\n----> 1 m = SetterModel(-1, 3, np.pi)\r\n\r\n<ipython-input-9-2205235bd266> in __init__(self, xc, yc, p)\r\n      8 \r\n      9     def __init__(self, xc, yc, p):\r\n---> 10         super(SetterModel, self).__init__()\r\n     11         self.p = p # p is a value intended to be used by the setter\r\n     12         self.xc = xc\r\n\r\n.../astropy/modeling/core.pyc in __init__(self, *args, **kwargs)\r\n    685         # Parameter values must be passed in as keyword arguments in order to\r\n    686         # distinguish them\r\n--> 687         self._initialize_parameters(args, kwargs)\r\n    688 \r\n    689     def __repr__(self):\r\n\r\n.../astropy/modeling/core.pyc in _initialize_parameters(self, args, kwargs)\r\n   1484 \r\n   1485         self._n_models = n_models\r\n-> 1486         self._initialize_parameter_values(params)\r\n   1487 \r\n   1488     def _initialize_parameter_values(self, params):\r\n\r\n.../astropy/modeling/core.pyc in _initialize_parameter_values(self, params)\r\n   1531             value = np.array(value)\r\n   1532             if param_descr._setter is not None:\r\n-> 1533                 value = param_descr._setter(value)\r\n   1534             self._parameters[param_metrics[name]['slice']] = value.ravel()\r\n   1535 \r\n\r\n<ipython-input-6-d86420f374f3> in setter2(val, model)\r\n      2     print(model)\r\n      3     model.do_something(val)\r\n----> 4     return val * model.p\r\n      5 \r\n\r\nAttributeError: 'SetterModel' object has no attribute 'p'\r\n```"}}