{"action":"created","issue":{"url":"https://api.github.com/repos/LiberTEM/LiberTEM/issues/230","repository_url":"https://api.github.com/repos/LiberTEM/LiberTEM","labels_url":"https://api.github.com/repos/LiberTEM/LiberTEM/issues/230/labels{/name}","comments_url":"https://api.github.com/repos/LiberTEM/LiberTEM/issues/230/comments","events_url":"https://api.github.com/repos/LiberTEM/LiberTEM/issues/230/events","html_url":"https://github.com/LiberTEM/LiberTEM/issues/230","id":395086055,"node_id":"MDU6SXNzdWUzOTUwODYwNTU=","number":230,"title":"Executing the \"basic.py\" example fails","user":{"login":"uellue","id":25689052,"node_id":"MDQ6VXNlcjI1Njg5MDUy","avatar_url":"https://avatars2.githubusercontent.com/u/25689052?v=4","gravatar_id":"","url":"https://api.github.com/users/uellue","html_url":"https://github.com/uellue","followers_url":"https://api.github.com/users/uellue/followers","following_url":"https://api.github.com/users/uellue/following{/other_user}","gists_url":"https://api.github.com/users/uellue/gists{/gist_id}","starred_url":"https://api.github.com/users/uellue/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uellue/subscriptions","organizations_url":"https://api.github.com/users/uellue/orgs","repos_url":"https://api.github.com/users/uellue/repos","events_url":"https://api.github.com/users/uellue/events{/privacy}","received_events_url":"https://api.github.com/users/uellue/received_events","type":"User","site_admin":false},"labels":[{"id":800580341,"node_id":"MDU6TGFiZWw4MDA1ODAzNDE=","url":"https://api.github.com/repos/LiberTEM/LiberTEM/labels/bug","name":"bug","color":"ee0701","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2019-01-01T14:06:04Z","updated_at":"2019-01-01T14:51:52Z","closed_at":null,"author_association":"MEMBER","body":"This doesn't occur with the equivalent RAW file, i.e. seems to be something specific to HDF5.\r\n\r\nError message:\r\n\r\n```\r\n(libertem) C:\\Users\\weber\\Documents\\LiberTEM\\LiberTEM>python examples\\basic.py\r\ntornado.application - ERROR - Exception in Future <Future cancelled> after timeout\r\nTraceback (most recent call last):\r\n  File \"C:\\Users\\weber\\AppData\\Local\\conda\\conda\\envs\\libertem\\lib\\site-packages\\tornado\\gen.py\", line 970, in error_callback\r\n    future.result()\r\nconcurrent.futures._base.CancelledError\r\nTraceback (most recent call last):\r\n  File \"C:\\Users\\weber\\AppData\\Local\\conda\\conda\\envs\\libertem\\lib\\site-packages\\dask\\base.py\", line 643, in normalize_function\r\n    return function_cache[func]\r\nKeyError: <exception str() failed>\r\n\r\nDuring handling of the above exception, another exception occurred:\r\n\r\nTraceback (most recent call last):\r\n  File \"C:\\Users\\weber\\AppData\\Local\\conda\\conda\\envs\\libertem\\lib\\site-packages\\dask\\base.py\", line 643, in normalize_function\r\n    return function_cache[func]\r\nKeyError: <exception str() failed>\r\n\r\nDuring handling of the above exception, another exception occurred:\r\n\r\nTraceback (most recent call last):\r\n  File \"C:\\Users\\weber\\AppData\\Local\\conda\\conda\\envs\\libertem\\lib\\copyreg.py\", line 69, in _reduce_ex\r\n    getstate = self.__getstate__\r\nAttributeError: 'Shape' object has no attribute '__getstate__'\r\n\r\nDuring handling of the above exception, another exception occurred:\r\n\r\nTraceback (most recent call last):\r\n  File \"C:\\Users\\weber\\AppData\\Local\\conda\\conda\\envs\\libertem\\lib\\site-packages\\dask\\base.py\", line 681, in _normalize_function\r\n    return cloudpickle.dumps(func, protocol=0)\r\n  File \"C:\\Users\\weber\\AppData\\Local\\conda\\conda\\envs\\libertem\\lib\\site-packages\\cloudpickle\\cloudpickle.py\", line 931, in dumps\r\n    cp.dump(obj)\r\n  File \"C:\\Users\\weber\\AppData\\Local\\conda\\conda\\envs\\libertem\\lib\\site-packages\\cloudpickle\\cloudpickle.py\", line 284, in dump\r\n    return Pickler.dump(self, obj)\r\n  File \"C:\\Users\\weber\\AppData\\Local\\conda\\conda\\envs\\libertem\\lib\\pickle.py\", line 409, in dump\r\n    self.save(obj)\r\n  File \"C:\\Users\\weber\\AppData\\Local\\conda\\conda\\envs\\libertem\\lib\\pickle.py\", line 476, in save\r\n    f(self, obj) # Call unbound method with explicit self\r\n  File \"C:\\Users\\weber\\AppData\\Local\\conda\\conda\\envs\\libertem\\lib\\site-packages\\cloudpickle\\cloudpickle.py\", line 703, in save_instancemethod\r\n    self.save_reduce(types.MethodType, (obj.__func__, obj.__self__), obj=obj)\r\n  File \"C:\\Users\\weber\\AppData\\Local\\conda\\conda\\envs\\libertem\\lib\\pickle.py\", line 610, in save_reduce\r\n    save(args)\r\n  File \"C:\\Users\\weber\\AppData\\Local\\conda\\conda\\envs\\libertem\\lib\\pickle.py\", line 476, in save\r\n    f(self, obj) # Call unbound method with explicit self\r\n  File \"C:\\Users\\weber\\AppData\\Local\\conda\\conda\\envs\\libertem\\lib\\pickle.py\", line 751, in save_tuple\r\n    save(element)\r\n  File \"C:\\Users\\weber\\AppData\\Local\\conda\\conda\\envs\\libertem\\lib\\pickle.py\", line 521, in save\r\n    self.save_reduce(obj=obj, *rv)\r\n  File \"C:\\Users\\weber\\AppData\\Local\\conda\\conda\\envs\\libertem\\lib\\pickle.py\", line 634, in save_reduce\r\n    save(state)\r\n  File \"C:\\Users\\weber\\AppData\\Local\\conda\\conda\\envs\\libertem\\lib\\pickle.py\", line 476, in save\r\n    f(self, obj) # Call unbound method with explicit self\r\n  File \"C:\\Users\\weber\\AppData\\Local\\conda\\conda\\envs\\libertem\\lib\\pickle.py\", line 821, in save_dict\r\n    self._batch_setitems(obj.items())\r\n  File \"C:\\Users\\weber\\AppData\\Local\\conda\\conda\\envs\\libertem\\lib\\pickle.py\", line 835, in _batch_setitems\r\n    save(v)\r\n  File \"C:\\Users\\weber\\AppData\\Local\\conda\\conda\\envs\\libertem\\lib\\pickle.py\", line 496, in save\r\n    rv = reduce(self.proto)\r\n  File \"C:\\Users\\weber\\AppData\\Local\\conda\\conda\\envs\\libertem\\lib\\copyreg.py\", line 72, in _reduce_ex\r\n    raise TypeError(\"a class that defines __slots__ without \"\r\nTypeError: a class that defines __slots__ without defining __getstate__ cannot be pickled\r\n\r\nDuring handling of the above exception, another exception occurred:\r\n\r\nTraceback (most recent call last):\r\n  File \"examples\\basic.py\", line 31, in <module>\r\n    tileshape=(1, 8, 128, 128)\r\n  File \"c:\\users\\weber\\documents\\libertem\\libertem\\src\\libertem\\api.py\", line 65, in load\r\n    ds = self.executor.run_function(ds.initialize)\r\n  File \"c:\\users\\weber\\documents\\libertem\\libertem\\src\\libertem\\executor\\dask.py\", line 124, in run_function\r\n    future = self.client.submit(functools.partial(fn, *args, **kwargs), priority=1)\r\n  File \"C:\\Users\\weber\\AppData\\Local\\conda\\conda\\envs\\libertem\\lib\\site-packages\\distributed\\client.py\", line 1246, in submit\r\n    key = funcname(func) + '-' + tokenize(func, kwargs, *args)\r\n  File \"C:\\Users\\weber\\AppData\\Local\\conda\\conda\\envs\\libertem\\lib\\site-packages\\dask\\base.py\", line 600, in tokenize\r\n    return md5(str(tuple(map(normalize_token, args))).encode()).hexdigest()\r\n  File \"C:\\Users\\weber\\AppData\\Local\\conda\\conda\\envs\\libertem\\lib\\site-packages\\dask\\utils.py\", line 413, in __call__\r\n    return meth(arg, *args, **kwargs)\r\n  File \"C:\\Users\\weber\\AppData\\Local\\conda\\conda\\envs\\libertem\\lib\\site-packages\\dask\\base.py\", line 634, in normalize_object\r\n    return normalize_function(o) if callable(o) else uuid.uuid4().hex\r\n  File \"C:\\Users\\weber\\AppData\\Local\\conda\\conda\\envs\\libertem\\lib\\site-packages\\dask\\base.py\", line 645, in normalize_function\r\n    result = _normalize_function(func)\r\n  File \"C:\\Users\\weber\\AppData\\Local\\conda\\conda\\envs\\libertem\\lib\\site-packages\\dask\\base.py\", line 671, in _normalize_function\r\n    return (normalize_function(func.func), args, kws)\r\n  File \"C:\\Users\\weber\\AppData\\Local\\conda\\conda\\envs\\libertem\\lib\\site-packages\\dask\\base.py\", line 645, in normalize_function\r\n    result = _normalize_function(func)\r\n  File \"C:\\Users\\weber\\AppData\\Local\\conda\\conda\\envs\\libertem\\lib\\site-packages\\dask\\base.py\", line 683, in _normalize_function\r\n    return str(func)\r\n  File \"c:\\users\\weber\\documents\\libertem\\libertem\\src\\libertem\\io\\dataset\\hdf5.py\", line 129, in __repr__\r\n    return \"<H5DataSet of %s shape=%s>\" % (self.dtype, self.shape)\r\n  File \"c:\\users\\weber\\documents\\libertem\\libertem\\src\\libertem\\io\\dataset\\hdf5.py\", line 82, in dtype\r\n    raise RuntimeError(\"please call initialize\")\r\nRuntimeError: please call initialize\r\n```"},"comment":{"url":"https://api.github.com/repos/LiberTEM/LiberTEM/issues/comments/450735978","html_url":"https://github.com/LiberTEM/LiberTEM/issues/230#issuecomment-450735978","issue_url":"https://api.github.com/repos/LiberTEM/LiberTEM/issues/230","id":450735978,"node_id":"MDEyOklzc3VlQ29tbWVudDQ1MDczNTk3OA==","user":{"login":"sk1p","id":5778,"node_id":"MDQ6VXNlcjU3Nzg=","avatar_url":"https://avatars2.githubusercontent.com/u/5778?v=4","gravatar_id":"","url":"https://api.github.com/users/sk1p","html_url":"https://github.com/sk1p","followers_url":"https://api.github.com/users/sk1p/followers","following_url":"https://api.github.com/users/sk1p/following{/other_user}","gists_url":"https://api.github.com/users/sk1p/gists{/gist_id}","starred_url":"https://api.github.com/users/sk1p/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sk1p/subscriptions","organizations_url":"https://api.github.com/users/sk1p/orgs","repos_url":"https://api.github.com/users/sk1p/repos","events_url":"https://api.github.com/users/sk1p/events{/privacy}","received_events_url":"https://api.github.com/users/sk1p/received_events","type":"User","site_admin":false},"created_at":"2019-01-01T14:51:52Z","updated_at":"2019-01-01T14:51:52Z","author_association":"COLLABORATOR","body":"The crucial parts of the error:\r\n\r\n> `AttributeError: 'Shape' object has no attribute '__getstate__'`\r\n[...]\r\n> `TypeError: a class that defines __slots__ without defining __getstate__ cannot be pickled`\r\n\r\nSo, need to implement `__getstate__` on classes to make them pickleable again."}}
{"actor":{"display_login":"sk1p"}}