Parse a list literal into a numpy.array e.g. :code:`ne3.NumExpr( 'a < [1,2,3]' )` Only numbers are supported at present. Mixing floats and integers results in a float array.
(self: NumExpr, node: ast.AST)
| 1396 | return outputRegister |
| 1397 | |
| 1398 | def _list(self: NumExpr, node: ast.AST) -> NumReg: |
| 1399 | ''' |
| 1400 | Parse a list literal into a numpy.array e.g. |
| 1401 | :code:`ne3.NumExpr( 'a < [1,2,3]' )` |
| 1402 | |
| 1403 | Only numbers are supported at present. Mixing floats and integers results |
| 1404 | in a float array. |
| 1405 | ''' |
| 1406 | regToken = next(self._regCount) |
| 1407 | |
| 1408 | arrayRepr = np.array([element.n for element in node.elts]) |
| 1409 | self.registers[regToken] = register = NumReg(regToken, regToken, arrayRepr, arrayRepr.dtype.char, _KIND_ARRAY) |
| 1410 | return register |
| 1411 | |
| 1412 | |
| 1413 | def _unsupported(self: NumExpr, node: ast.AST) -> None: |
nothing calls this directly
no test coverage detected
searching dependent graphs…