{"action":"created","issue":{"url":"https://api.github.com/repos/pydata/numexpr/issues/308","repository_url":"https://api.github.com/repos/pydata/numexpr","labels_url":"https://api.github.com/repos/pydata/numexpr/issues/308/labels{/name}","comments_url":"https://api.github.com/repos/pydata/numexpr/issues/308/comments","events_url":"https://api.github.com/repos/pydata/numexpr/issues/308/events","html_url":"https://github.com/pydata/numexpr/issues/308","id":344961134,"node_id":"MDU6SXNzdWUzNDQ5NjExMzQ=","number":308,"title":"NE3 sum fails for a complex array","user":{"login":"s-sajid-ali","id":30510036,"node_id":"MDQ6VXNlcjMwNTEwMDM2","avatar_url":"https://avatars1.githubusercontent.com/u/30510036?v=4","gravatar_id":"","url":"https://api.github.com/users/s-sajid-ali","html_url":"https://github.com/s-sajid-ali","followers_url":"https://api.github.com/users/s-sajid-ali/followers","following_url":"https://api.github.com/users/s-sajid-ali/following{/other_user}","gists_url":"https://api.github.com/users/s-sajid-ali/gists{/gist_id}","starred_url":"https://api.github.com/users/s-sajid-ali/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/s-sajid-ali/subscriptions","organizations_url":"https://api.github.com/users/s-sajid-ali/orgs","repos_url":"https://api.github.com/users/s-sajid-ali/repos","events_url":"https://api.github.com/users/s-sajid-ali/events{/privacy}","received_events_url":"https://api.github.com/users/s-sajid-ali/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-07-26T18:44:01Z","updated_at":"2018-07-26T20:43:40Z","closed_at":"2018-07-26T20:43:40Z","author_association":"NONE","body":"Summing a complex array works in numexpr2 but fails in numexpr3. \r\n\r\n```\r\nimport numpy as np\r\nimport numexpr3 as ne3\r\nimport numexpr as ne\r\ntest = np.random.random((5,5))+1j*(np.random.random((5,5)))\r\nne.evaluate('sum(test)')\r\nne3.evaluate('sum(test)')\r\n```\r\nGives the error : \r\n```\r\n---------------------------------------------------------------------------\r\nKeyError                                  Traceback (most recent call last)\r\n<ipython-input-26-c30da8a82b58> in <module>()\r\n      4 test = np.random.random((5,5))+1j*(np.random.random((5,5)))\r\n      5 ne.evaluate('sum(test)')\r\n----> 6 ne3.evaluate('sum(test)')\r\n\r\n~/packages/spack/opt/spack/linux-rhel7-x86_64/gcc-4.8.5/miniconda3-4.5.4-mnrjuglmkgo4c563kzynlrdmrpme5jza/envs/py3test/lib/python3.6/site-packages/numexpr3/ne3compiler.py in evaluate(expr, name, lib, local_dict, global_dict, out, order, casting, optimization, library, checks, stackDepth)\r\n    211             pass\r\n    212 \r\n--> 213     neObj = NumExpr(expr, lib=lib, casting=casting, stackDepth=stackDepth+1)\r\n    214     return neObj.run(verify=False)\r\n    215     # End of ne3.evaluate()\r\n\r\n~/packages/spack/opt/spack/linux-rhel7-x86_64/gcc-4.8.5/miniconda3-4.5.4-mnrjuglmkgo4c563kzynlrdmrpme5jza/envs/py3test/lib/python3.6/site-packages/numexpr3/ne3compiler.py in __init__(self, expr, lib, casting, local_dict, stackDepth)\r\n    986         self.timings['frame_call'] = perf_counter() - t1\r\n    987         self.timings['__init__']   = t1-t0\r\n--> 988         self._assemble()\r\n    989 \r\n    990     def __getstate__(self):\r\n\r\n~/packages/spack/opt/spack/linux-rhel7-x86_64/gcc-4.8.5/miniconda3-4.5.4-mnrjuglmkgo4c563kzynlrdmrpme5jza/envs/py3test/lib/python3.6/site-packages/numexpr3/ne3compiler.py in _assemble(self)\r\n   1031         # Do the _last_ assignment/expression with magic_output\r\n   1032         bodyItem = forest.body[-1]\r\n-> 1033         _ASTAssembler[type(bodyItem),-1](self,bodyItem)\r\n   1034 \r\n   1035         t2 = perf_counter()\r\n\r\n~/packages/spack/opt/spack/linux-rhel7-x86_64/gcc-4.8.5/miniconda3-4.5.4-mnrjuglmkgo4c563kzynlrdmrpme5jza/envs/py3test/lib/python3.6/site-packages/numexpr3/ne3compiler.py in _expression_last(self, node)\r\n    263     # info(  '$ast.Expression, flow: LAST' )\r\n    264 \r\n--> 265     valueReg = _ASTAssembler[type(node.value)](self, node.value)\r\n    266     # Make a substitute output node\r\n    267     targetNode = ast.Name('$out', None)\r\n\r\n~/packages/spack/opt/spack/linux-rhel7-x86_64/gcc-4.8.5/miniconda3-4.5.4-mnrjuglmkgo4c563kzynlrdmrpme5jza/envs/py3test/lib/python3.6/site-packages/numexpr3/ne3compiler.py in _call(self, node)\r\n    621         opSig = (node.func.id, self.lib, argReg0.dchar)\r\n    622 \r\n--> 623         argReg0, opSig = self._func_cast(argReg0, opSig)\r\n    624         opCode, self.assignDChar = OPTABLE[opSig]\r\n    625         outputRegister = self._transmit1(argReg0)\r\n\r\n~/packages/spack/opt/spack/linux-rhel7-x86_64/gcc-4.8.5/miniconda3-4.5.4-mnrjuglmkgo4c563kzynlrdmrpme5jza/envs/py3test/lib/python3.6/site-packages/numexpr3/ne3compiler.py in _func_cast(self, unaryRegister, opSig)\r\n   1347 \r\n   1348         funcName, castConvention, dchar = opSig\r\n-> 1349         castDchar = _CAST1_SUGGEST[dchar]\r\n   1350         castSig = (funcName, castConvention, castDchar)\r\n   1351         if not castSig in OPTABLE:\r\n\r\nKeyError: 'D'\r\n\r\n​```"},"comment":{"url":"https://api.github.com/repos/pydata/numexpr/issues/comments/408229082","html_url":"https://github.com/pydata/numexpr/issues/308#issuecomment-408229082","issue_url":"https://api.github.com/repos/pydata/numexpr/issues/308","id":408229082,"node_id":"MDEyOklzc3VlQ29tbWVudDQwODIyOTA4Mg==","user":{"login":"robbmcleod","id":5999769,"node_id":"MDQ6VXNlcjU5OTk3Njk=","avatar_url":"https://avatars1.githubusercontent.com/u/5999769?v=4","gravatar_id":"","url":"https://api.github.com/users/robbmcleod","html_url":"https://github.com/robbmcleod","followers_url":"https://api.github.com/users/robbmcleod/followers","following_url":"https://api.github.com/users/robbmcleod/following{/other_user}","gists_url":"https://api.github.com/users/robbmcleod/gists{/gist_id}","starred_url":"https://api.github.com/users/robbmcleod/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robbmcleod/subscriptions","organizations_url":"https://api.github.com/users/robbmcleod/orgs","repos_url":"https://api.github.com/users/robbmcleod/repos","events_url":"https://api.github.com/users/robbmcleod/events{/privacy}","received_events_url":"https://api.github.com/users/robbmcleod/received_events","type":"User","site_admin":false},"created_at":"2018-07-26T20:43:40Z","updated_at":"2018-07-26T20:43:40Z","author_association":"MEMBER","body":"Reductions are not implemented in `numexpr3`. It's still considered to be an alpha-state, so there are regressions like this, and the lack of string support. If you would like to discuss it please use #255."}}
{"actor":{"display_login":"robbmcleod"}}