Lambdify support#12
Conversation
|
Hello @cjayross! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:
Comment last updated at 2019-07-09 07:07:47 UTC |
Codecov Report
@@ Coverage Diff @@
## master #12 +/- ##
=========================================
- Coverage 94.72% 88.5% -6.23%
=========================================
Files 9 10 +1
Lines 512 548 +36
=========================================
Hits 485 485
- Misses 27 63 +36
Continue to review full report at Codecov.
|
This reverts commit 014c284.
Addresses #3
This is an important merge as it provides a convenient and efficient way to convert tensor expressions into numerical functions that can be used in algorithms like Runge-Kutta.
I defined a new class called
NumericalArraywhich has two important attributes. The first is an attribute called_lambdawhich is the lambdified function for the entire array. The second is_generatorwhich is an array where each individual component is a lambda function for that specific component. This is an important distinction since this allows for calculating single components without having to do calculations for every other component as well (which is what_lambdadoes).These attributes are accessed very easily by defining the
__call__and__getitem__attributes. Calling an instance ofNumericalArrayis equivalent to calling it's_lambdaargument while accessing a component like an array returns a lambda for that component, which can be subsequently called just the same.Note: The changes currently lack test cases unfortunately.