{"action":"created","issue":{"url":"https://api.github.com/repos/QInfer/python-qinfer/issues/59","repository_url":"https://api.github.com/repos/QInfer/python-qinfer","labels_url":"https://api.github.com/repos/QInfer/python-qinfer/issues/59/labels{/name}","comments_url":"https://api.github.com/repos/QInfer/python-qinfer/issues/59/comments","events_url":"https://api.github.com/repos/QInfer/python-qinfer/issues/59/events","html_url":"https://github.com/QInfer/python-qinfer/issues/59","id":155949481,"number":59,"title":"TomographyModel expparams_dtype broken in Python 2","user":{"login":"cgranade","id":31516,"avatar_url":"https://avatars.githubusercontent.com/u/31516?v=3","gravatar_id":"","url":"https://api.github.com/users/cgranade","html_url":"https://github.com/cgranade","followers_url":"https://api.github.com/users/cgranade/followers","following_url":"https://api.github.com/users/cgranade/following{/other_user}","gists_url":"https://api.github.com/users/cgranade/gists{/gist_id}","starred_url":"https://api.github.com/users/cgranade/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cgranade/subscriptions","organizations_url":"https://api.github.com/users/cgranade/orgs","repos_url":"https://api.github.com/users/cgranade/repos","events_url":"https://api.github.com/users/cgranade/events{/privacy}","received_events_url":"https://api.github.com/users/cgranade/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2016-05-20T12:11:53Z","updated_at":"2016-06-10T01:21:51Z","closed_at":null,"body":"The Python 3 port at one point required ``unicode_literals`` to be turned on for ``tomography/models.py``, landing us right in the fallout from numpy/numpy#2407. As a result, ``TomographyModel.expparams_dtype`` is not understood by ``np.empty``, ``np.array`` and friends:\r\n\r\n```\r\nTypeError                                 Traceback (most recent call last)\r\n<ipython-input-82-aeaa035a166b> in <module>()\r\n      1 updater = qi.SMCUpdater(model, 20000, prior)\r\n----> 2 expparams = np.empty((1,), dtype=model.expparams_dtype)\r\n\r\nTypeError: data type not understood\r\n```\r\n\r\nUntil we can fix this, a work around is to manually creating expparam arrays with field names specified as ``str``."},"comment":{"url":"https://api.github.com/repos/QInfer/python-qinfer/issues/comments/225071562","html_url":"https://github.com/QInfer/python-qinfer/issues/59#issuecomment-225071562","issue_url":"https://api.github.com/repos/QInfer/python-qinfer/issues/59","id":225071562,"user":{"login":"scasagrande","id":1554809,"avatar_url":"https://avatars.githubusercontent.com/u/1554809?v=3","gravatar_id":"","url":"https://api.github.com/users/scasagrande","html_url":"https://github.com/scasagrande","followers_url":"https://api.github.com/users/scasagrande/followers","following_url":"https://api.github.com/users/scasagrande/following{/other_user}","gists_url":"https://api.github.com/users/scasagrande/gists{/gist_id}","starred_url":"https://api.github.com/users/scasagrande/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scasagrande/subscriptions","organizations_url":"https://api.github.com/users/scasagrande/orgs","repos_url":"https://api.github.com/users/scasagrande/repos","events_url":"https://api.github.com/users/scasagrande/events{/privacy}","received_events_url":"https://api.github.com/users/scasagrande/received_events","type":"User","site_admin":false},"created_at":"2016-06-10T01:21:51Z","updated_at":"2016-06-10T01:21:51Z","body":"What is this, I don't even...\r\n\r\nThe only other solution is (ugh) checking what the primary python version is at run time, and doing a \r\n\r\n```python\r\nfrom builtin import str, bytes\r\nif sys.version_info[0] >=3:\r\n    str(thing)\r\nelse:\r\n    bytes(thing)\r\n```\r\n\r\nOtherwise, carry on then..."}}
{"actor":{"display_login":"scasagrande"}}