{"action":"created","issue":{"url":"https://api.github.com/repos/giacomov/3ML/issues/218","repository_url":"https://api.github.com/repos/giacomov/3ML","labels_url":"https://api.github.com/repos/giacomov/3ML/issues/218/labels{/name}","comments_url":"https://api.github.com/repos/giacomov/3ML/issues/218/comments","events_url":"https://api.github.com/repos/giacomov/3ML/issues/218/events","html_url":"https://github.com/giacomov/3ML/issues/218","id":240443220,"number":218,"title":"JointLikelihoodSet parallel loosing track of parameter paths","user":{"login":"grburgess","id":6764007,"avatar_url":"https://avatars2.githubusercontent.com/u/6764007?v=3","gravatar_id":"","url":"https://api.github.com/users/grburgess","html_url":"https://github.com/grburgess","followers_url":"https://api.github.com/users/grburgess/followers","following_url":"https://api.github.com/users/grburgess/following{/other_user}","gists_url":"https://api.github.com/users/grburgess/gists{/gist_id}","starred_url":"https://api.github.com/users/grburgess/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/grburgess/subscriptions","organizations_url":"https://api.github.com/users/grburgess/orgs","repos_url":"https://api.github.com/users/grburgess/repos","events_url":"https://api.github.com/users/grburgess/events{/privacy}","received_events_url":"https://api.github.com/users/grburgess/received_events","type":"User","site_admin":false},"labels":[{"id":150151806,"url":"https://api.github.com/repos/giacomov/3ML/labels/bug","name":"bug","color":"fc2929","default":true}],"state":"open","locked":false,"assignee":{"login":"giacomov","id":5917371,"avatar_url":"https://avatars3.githubusercontent.com/u/5917371?v=3","gravatar_id":"","url":"https://api.github.com/users/giacomov","html_url":"https://github.com/giacomov","followers_url":"https://api.github.com/users/giacomov/followers","following_url":"https://api.github.com/users/giacomov/following{/other_user}","gists_url":"https://api.github.com/users/giacomov/gists{/gist_id}","starred_url":"https://api.github.com/users/giacomov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/giacomov/subscriptions","organizations_url":"https://api.github.com/users/giacomov/orgs","repos_url":"https://api.github.com/users/giacomov/repos","events_url":"https://api.github.com/users/giacomov/events{/privacy}","received_events_url":"https://api.github.com/users/giacomov/received_events","type":"User","site_admin":false},"assignees":[{"login":"giacomov","id":5917371,"avatar_url":"https://avatars3.githubusercontent.com/u/5917371?v=3","gravatar_id":"","url":"https://api.github.com/users/giacomov","html_url":"https://github.com/giacomov","followers_url":"https://api.github.com/users/giacomov/followers","following_url":"https://api.github.com/users/giacomov/following{/other_user}","gists_url":"https://api.github.com/users/giacomov/gists{/gist_id}","starred_url":"https://api.github.com/users/giacomov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/giacomov/subscriptions","organizations_url":"https://api.github.com/users/giacomov/orgs","repos_url":"https://api.github.com/users/giacomov/repos","events_url":"https://api.github.com/users/giacomov/events{/privacy}","received_events_url":"https://api.github.com/users/giacomov/received_events","type":"User","site_admin":false}],"milestone":null,"comments":2,"created_at":"2017-07-04T14:53:42Z","updated_at":"2017-07-11T07:02:38Z","closed_at":null,"body":"I believe that this has to do with the model living either in the cluster or locally, but when attempting to do JLSet with the parallel context manager, it appears that the parameter paths get screwed up. \r\n\r\n\r\nI have set it up like this:\r\n\r\n```python\r\n\r\ndef get_data(id):\r\n    return data\r\n\r\ndef get_model(id):\r\n\r\n   spec = Powerlaw()\r\n   ps = PointSource('test',0,0,spec)\r\n   model= Model(ps)\r\n\r\n   return model\r\n\r\n\r\njl = JointLikelihoodSet(model_getter=get_model, data_getter=get_data, n_iterations=200)\r\n\r\nwith parallel_computation(profile='3ml', start_cluster=False):\r\n    \r\n    _ = jl.go(compute_covariance=True)\r\n\r\n\r\n\r\n```\r\n\r\nWithout parallel computation, everything is fine. But when it is turned on, then the following error is reported:\r\n\r\n\r\n```python\r\njl.results[1].display()\r\n\r\nAssertionError                            Traceback (most recent call last)\r\n<ipython-input-155-64aa3476a237> in <module>()\r\n----> 1 jl_set_bandpl.results[1].display()\r\n\r\n/Users/jburgess/coding/3ML/threeML/analysis_results.pyc in display(self, display_correlation, cl)\r\n   1196     def display(self, display_correlation=True, cl=0.68):\r\n   1197 \r\n-> 1198         best_fit_table = self._get_results_table(error_type=\"covariance\", cl=cl, covariance=self.covariance_matrix)\r\n   1199 \r\n   1200         print(\"Best fit values:\\n\")\r\n\r\n/Users/jburgess/coding/3ML/threeML/analysis_results.pyc in _get_results_table(self, error_type, cl, covariance)\r\n    617             parameter_paths.append(this_par.path)\r\n    618 \r\n--> 619             this_phys_q = self.get_variates(parameter_paths[-1])\r\n    620 \r\n    621             values.append(this_phys_q.value)\r\n\r\n/Users/jburgess/coding/3ML/threeML/analysis_results.pyc in get_variates(self, param_path)\r\n    421 \r\n    422         assert param_path in self._optimized_model.free_parameters, \"Parameter %s is not a \" \\\r\n--> 423                                                                     \"free parameters of the model\" % param_path\r\n    424 \r\n    425         param_index = self._free_parameters.keys().index(param_path)\r\n\r\nAssertionError: Parameter K_1 is not a free parameters of the model\r\n\r\n```\r\n\r\nIt seems the parameter is chopping off the leading parts of the path.\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/giacomov/3ML/issues/comments/314353940","html_url":"https://github.com/giacomov/3ML/issues/218#issuecomment-314353940","issue_url":"https://api.github.com/repos/giacomov/3ML/issues/218","id":314353940,"user":{"login":"grburgess","id":6764007,"avatar_url":"https://avatars2.githubusercontent.com/u/6764007?v=3","gravatar_id":"","url":"https://api.github.com/users/grburgess","html_url":"https://github.com/grburgess","followers_url":"https://api.github.com/users/grburgess/followers","following_url":"https://api.github.com/users/grburgess/following{/other_user}","gists_url":"https://api.github.com/users/grburgess/gists{/gist_id}","starred_url":"https://api.github.com/users/grburgess/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/grburgess/subscriptions","organizations_url":"https://api.github.com/users/grburgess/orgs","repos_url":"https://api.github.com/users/grburgess/repos","events_url":"https://api.github.com/users/grburgess/events{/privacy}","received_events_url":"https://api.github.com/users/grburgess/received_events","type":"User","site_admin":false},"created_at":"2017-07-11T07:02:38Z","updated_at":"2017-07-11T07:02:38Z","body":"Ooops. \r\n\r\nI mean this:\r\n\r\nI have set it up like this:\r\n\r\n```python\r\n\r\ndef get_data(id):\r\n    return data\r\n\r\ndef get_model(id):\r\n\r\n   spec = Powerlaw() * Constant()\r\n   ps = PointSource('test',0,0,spec)\r\n   model= Model(ps)\r\n\r\n   return model\r\n\r\n\r\njl = JointLikelihoodSet(model_getter=get_model, data_getter=get_data, n_iterations=200)\r\n\r\nwith parallel_computation(profile='3ml', start_cluster=False):\r\n    \r\n    _ = jl.go(compute_covariance=True)\r\n\r\n\r\n\r\n```"}}
{"actor":{"display_login":"grburgess"}}