Skip to content

Use prefer_literal flag in overload - #116

Merged
albop merged 1 commit into
EconForge:masterfrom
kp992:i-115
Jul 12, 2024
Merged

albop merged 1 commit into
EconForge:masterfrom
kp992:i-115

Conversation

@kp992

@kp992 kp992 commented Jul 4, 2024

Copy link
Copy Markdown
Contributor

Fixes #115.

With this diff and numba=0.60, all the splines tests are working fine:

% pytest interpolation/splines/tests
============================= test session starts ==============================
platform darwin -- Python 3.10.12, pytest-8.1.0, pluggy-1.4.0
rootdir: /Users/kpl/repos/interpolation.py
configfile: pyproject.toml
plugins: anyio-4.0.0
collected 13 items                                                             

interpolation/splines/tests/test_cubic_splines.py ....                   [ 30%]
interpolation/splines/tests/test_derivatives.py .                        [ 38%]
interpolation/splines/tests/test_eval_splines.py .                       [ 46%]
interpolation/splines/tests/test_fortran_order.py ..                     [ 61%]
interpolation/splines/tests/test_hermite_splines.py .                    [ 69%]
interpolation/splines/tests/test_multilinear_extrap.py .                 [ 76%]
interpolation/splines/tests/test_object_api.py .                         [ 84%]
interpolation/splines/tests/test_readonly.py ..                          [100%]

============================= 13 passed in 23.71s ==============================

cc @albop

@mmcky

mmcky commented Jul 5, 2024

Copy link
Copy Markdown

thanks @kp992.

@albop this looks good to me. If you have time it would be great to merge and release an update.

@mmcky

mmcky commented Jul 11, 2024

Copy link
Copy Markdown

@kp992 will this only work for numba>=0.60? We will likely need to cater for a couple of versions of numba

@kp992

kp992 commented Jul 12, 2024

Copy link
Copy Markdown
Contributor Author

@kp992 This works for numba=0.60, 0.59 and 0.58. I have tested them locally.

@albop

albop commented Jul 12, 2024

Copy link
Copy Markdown
Member

Thank you very much @kp992 !
I wasn' t sure how to deal with this new numba behaviour when they removed generated_jit.
Your patch works and looks logical.
I'll merge it now. The tests in master still cover python 3.8, which is an older version of numba. Should be informative.

@albop
albop merged commit e9cc804 into EconForge:master Jul 12, 2024
@albop

albop commented Jul 12, 2024

Copy link
Copy Markdown
Member

The tests all use 0.60, but I replicated what @kp992 has done locally. They pass with 0.59 and 0.60.
I'll make a release later tonight

@kp992
kp992 deleted the i-115 branch July 12, 2024 16:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AttributeError: 'Integer' object has no attribute 'literal_value'

3 participants