Skip to content

Use np.interp instead of interpolation.interp#156

Merged
mmcky merged 5 commits intomainfrom
interp_fixes
Apr 29, 2024
Merged

Use np.interp instead of interpolation.interp#156
mmcky merged 5 commits intomainfrom
interp_fixes

Conversation

@kp992
Copy link
Copy Markdown
Collaborator

@kp992 kp992 commented Mar 6, 2024

This PR replaces all the occurences of interpolation.interp to np.interp now that numba supports np.interp directly.

@kp992 kp992 requested review from jstac and mmcky March 6, 2024 04:11
@jstac
Copy link
Copy Markdown
Contributor

jstac commented Mar 6, 2024

@mmcky and @HumphreyYang , could you please do a first round review of this?

The aim is that swapping to NumPy's interp does not change results or degrade performance.

@jstac
Copy link
Copy Markdown
Contributor

jstac commented Mar 6, 2024

Note that this is related to QuantEcon/lecture-python.myst#387

@mmcky
Copy link
Copy Markdown
Contributor

mmcky commented Mar 8, 2024

Thanks @kp992.

The last dependency on interpolations is in amss

lectures/amss.md:from interpolation.splines import eval_linear, UCGrid, nodes

@kp992 any scope to be able to remove interpolations as a dependency -- otherwise maybe we need to solve EconForge/interpolation.py#110 re: generated_jit to make use of this package in amss

@kp992
Copy link
Copy Markdown
Collaborator Author

kp992 commented Mar 9, 2024

Thanks for the review @mmcky.

The last dependency on interpolations is in amss

Yeah, I checked that. Its the only one left with interpolation.py.

@kp992 any scope to be able to remove interpolations as a dependency -- otherwise maybe we need to solve EconForge/interpolation.py#110 re: generated_jit to make use of this package in amss

Hmm, I will check with some scipy functions and if possible remove it in a follow-up PR.

@github-actions github-actions bot temporarily deployed to commit March 9, 2024 05:06 Inactive
@mmcky
Copy link
Copy Markdown
Contributor

mmcky commented Mar 11, 2024

@kp992 the lecture opt_tax_recur is failing due to issues with the nelder_mead function from quantecon. I am not sure why this is now failing as we haven't upgraded numba in this PR.

@github-actions github-actions bot temporarily deployed to commit March 12, 2024 02:11 Inactive
@kp992
Copy link
Copy Markdown
Collaborator Author

kp992 commented Mar 12, 2024

@mmcky Thanks for pointing out the issue. The CI is green.

@mmcky
Copy link
Copy Markdown
Contributor

mmcky commented Mar 12, 2024

thanks @kp992

Just documenting this is now the only use case of interpolations left

lectures/amss.md:from interpolation.splines import eval_linear, UCGrid, nodes

@mmcky mmcky merged commit 03196de into main Apr 29, 2024
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.

3 participants