EconForge / interpolation.py

BSD 2-Clause "Simplified" License
123 stars 35 forks source link

After 2.2.0 eval_linear needs C-order and dtype FLOAT64 #84

Closed MaximilianHoffmann closed 3 years ago

MaximilianHoffmann commented 3 years ago

My old code was broken from this version on since it didn't check that eval_linear needs C-order and dtype FLOAT64 in all its arguments:

numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopython frontend)
 13 No implementation of function Function(<function _eval_linear at 0x2b4d23038170>) found for signature:
 14 
 15  >>> _eval_linear(UniTuple(array(float64, 1d, C) x 3), array(float64, 3d, C), array(int64, 2d, F), Tuple(UniTuple(none x 1), UniTuple(none x 2)))
 16 
 17 There are 8 candidate implementations:
 18   - Of which 2 did not match due to:
 19   Overload in function '__eval_linear': File: interpolation/splines/eval_splines.py: Line 149.
 20     With argument(s): '(UniTuple(array(float64, 1d, C) x 3), array(float64, 3d, C), array(int64, 2d, F), Tuple(UniTuple(none x 1), UniTuple(none x 2)))':
 21    Rejected as the implementation raised a specific error:
 22      TypeError: __eval_linear() takes 3 positional arguments but 4 were given
 23   raised from /fast/users/hoffmmax_c/work/anaconda3/envs/img/lib/python3.7/site-packages/numba/core/typing/templates.py:710
 24   - Of which 1 did not match due to:
 25   Overload in function '__eval_linear': File: interpolation/splines/eval_splines.py: Line 154.
 26     With argument(s): '(UniTuple(array(float64, 1d, C) x 3), array(float64, 3d, C), array(int64, 2d, F), Tuple(UniTuple(none x 1), UniTuple(non
albop commented 3 years ago

This looks like a relatively easy to fix bug. Did you close the issue on purpose ?

MaximilianHoffmann commented 3 years ago

Yeah, since I just fixed the input in my code, but it took me some time to find the culprit. I thought this might save someone time.

albop commented 3 years ago

I imagine very well... I'll reopen the issue and make a fix. Ordering is dealt with by numba so we shouldn't add contraints to it.

Le mar. 30 mars 2021 à 10:25, Maximilian Hoffmann @.***> a écrit :

Yeah, since I just fixed the input in my code, but it took me some time to find the culprit. I thought this might save someone time.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/EconForge/interpolation.py/issues/84#issuecomment-810023414, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACDSKP7JXFJKEMPVF2FF6DTGGDGFANCNFSM4Z6DHEZA .