numexpr icon indicating copy to clipboard operation
numexpr copied to clipboard

NE3: Auto-NumExprize Script

Open robbmcleod opened this issue 8 years ago • 1 comments

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.

robbmcleod avatar Aug 26 '17 18:08 robbmcleod

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(...)`

robbmcleod avatar Dec 30 '17 17:12 robbmcleod

Message to comment on stale issues. If none provided, will not mark issues stale

github-actions[bot] avatar Feb 20 '24 01:02 github-actions[bot]