{"action":"created","issue":{"url":"https://api.github.com/repos/jamalsenouci/causalimpact/issues/1","repository_url":"https://api.github.com/repos/jamalsenouci/causalimpact","labels_url":"https://api.github.com/repos/jamalsenouci/causalimpact/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/jamalsenouci/causalimpact/issues/1/comments","events_url":"https://api.github.com/repos/jamalsenouci/causalimpact/issues/1/events","html_url":"https://github.com/jamalsenouci/causalimpact/issues/1","id":194101978,"number":1,"title":"Cannot import CausalImpact because of NameError:","user":{"login":"abernkopf","id":1875242,"avatar_url":"https://avatars.githubusercontent.com/u/1875242?v=3","gravatar_id":"","url":"https://api.github.com/users/abernkopf","html_url":"https://github.com/abernkopf","followers_url":"https://api.github.com/users/abernkopf/followers","following_url":"https://api.github.com/users/abernkopf/following{/other_user}","gists_url":"https://api.github.com/users/abernkopf/gists{/gist_id}","starred_url":"https://api.github.com/users/abernkopf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abernkopf/subscriptions","organizations_url":"https://api.github.com/users/abernkopf/orgs","repos_url":"https://api.github.com/users/abernkopf/repos","events_url":"https://api.github.com/users/abernkopf/events{/privacy}","received_events_url":"https://api.github.com/users/abernkopf/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-12-07T16:44:42Z","updated_at":"2016-12-15T23:35:18Z","closed_at":null,"body":"When I import causalimpact, as such\r\n\r\n`import causalimpact`\r\n\r\nI get this error\r\n\r\n```\r\n---------------------------------------------------------------------------\r\nNameError                                 Traceback (most recent call last)\r\n<ipython-input-1-707f1b214cc6> in <module>()\r\n----> 1 import causalimpact\r\n\r\n/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/causalimpact-0.1-py2.7.egg/causalimpact/__init__.py in <module>()\r\n      7 \"\"\"\r\n      8 \r\n----> 9 from causalimpact.analysis import CausalImpact  # noqa\r\n     10 from causalimpact.tests.test import run as test  # noqa\r\n\r\n/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/causalimpact-0.1-py2.7.egg/causalimpact/analysis.py in <module>()\r\n      6 from causalimpact.misc import standardize_all_variables\r\n      7 from causalimpact.model import construct_model\r\n----> 8 from causalimpact.inferences import compile_posterior_inferences\r\n      9 \r\n     10 class CausalImpact(object):\r\n\r\n/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/causalimpact-0.1-py2.7.egg/causalimpact/inferences.py in <module>()\r\n      1 from causalimpact.misc import unstandardize\r\n      2 def compile_posterior_inferences(model, data_post, alpha=0.05,\r\n----> 3                                  orig_std_params=identity):\r\n      4 \r\n      5     # Compute point predictions of counterfactual (in standardized space)\r\n\r\nNameError: name 'identity' is not defined\r\n```\r\n\r\nI looked at the source code and found that identity is a default arg for `compile_posterior_inferences`, but identity doesn't exist. I looked elsewhere in the code to see if identity is referenced elsewhere to see if I could fix it myself, and found that theres this: `orig_std_params = np.identity` on line 243 of analysis.py, but np.identity is a function that returns the identity matrix. It it assigned to the variable orig_std_params without actually giving np.identity an argument. The orig_std_params variable is then reassigned to some other value. So I couldn't make sense of how to fix the code. Also, `compile_na_inferences` in inferences.py doesn't do anything, seems wrong because the function is used elsewhere in the package. \r\n\r\nSo I don't know how to use the package as such.... \r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/jamalsenouci/causalimpact/issues/comments/267476329","html_url":"https://github.com/jamalsenouci/causalimpact/issues/1#issuecomment-267476329","issue_url":"https://api.github.com/repos/jamalsenouci/causalimpact/issues/1","id":267476329,"user":{"login":"oostopitre","id":3135345,"avatar_url":"https://avatars.githubusercontent.com/u/3135345?v=3","gravatar_id":"","url":"https://api.github.com/users/oostopitre","html_url":"https://github.com/oostopitre","followers_url":"https://api.github.com/users/oostopitre/followers","following_url":"https://api.github.com/users/oostopitre/following{/other_user}","gists_url":"https://api.github.com/users/oostopitre/gists{/gist_id}","starred_url":"https://api.github.com/users/oostopitre/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oostopitre/subscriptions","organizations_url":"https://api.github.com/users/oostopitre/orgs","repos_url":"https://api.github.com/users/oostopitre/repos","events_url":"https://api.github.com/users/oostopitre/events{/privacy}","received_events_url":"https://api.github.com/users/oostopitre/received_events","type":"User","site_admin":false},"created_at":"2016-12-15T23:35:18Z","updated_at":"2016-12-15T23:35:18Z","body":"Is there a known workaround to getting this to work so that we can play with the existing functionality of the library?"}}
{"actor":{"display_login":"oostopitre"}}