numexpr
numexpr copied to clipboard
NE3: Auto-NumExprize Script
A long-term goal for NE3 could be to write a script that would AST parse another script, and then find the tallest trees that use only NumPy supported functions and convert them into NE3 object calls.
Perhaps a intermediate approach would be to simply allow the ast parser to recognize numpy. attributes as potential function calls, so the user doesn't have to bother with dropping the module handles when switching from NumPy prototype to NumExpr. It would cost ~20 us of extra parse time per numpy. attribute access.
This could be further extended to allow mapping to the underlying math libraries (once we get there) to allow mixing libraries within a single statement.
E.g.
`erf(...)*numpy.sin(...)`
versus
`erf(...)*yep.sin(...)`
or
`erf(...)*mkl.sin(...)`
Message to comment on stale issues. If none provided, will not mark issues stale