MCPcopy Create free account
hub / github.com/pydata/numexpr / _list

Function _list

numexpr3/ne3compiler.py:1398–1410  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

1396 return outputRegister
1397
1398def _list(self: NumExpr, node: ast.AST) -> NumReg:
1399 ''&#x27;
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 ''&#x27;
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
1413def _unsupported(self: NumExpr, node: ast.AST) -> None:

Callers

nothing calls this directly

Calls 1

NumRegClass · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…