Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ENH: add njit interpolation functions #724

Closed
wants to merge 3 commits into from
Closed

ENH: add njit interpolation functions #724

wants to merge 3 commits into from

Conversation

mmcky
Copy link
Contributor

@mmcky mmcky commented Mar 4, 2024

This PR adds the following interpolation functions

  • interp that accepts x as float or np.array

and the following internal functions:

  • _interpf that accepts x as float
  • _interpa that accepts x as np.array

@pep8speaks
Copy link

pep8speaks commented Mar 4, 2024

Hello @mmcky! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

Line 3:1: E302 expected 2 blank lines, found 1
Line 7:1: W293 blank line contains whitespace
Line 45:1: W293 blank line contains whitespace
Line 84:1: W293 blank line contains whitespace
Line 107:13: W292 no newline at end of file

Line 6:1: E302 expected 2 blank lines, found 1
Line 24:36: W292 no newline at end of file

Comment last updated at 2024-03-04 00:48:39 UTC

@oyamad
Copy link
Member

oyamad commented Mar 4, 2024

np.interp is available through Numba: see https://numba.pydata.org/numba-doc/dev/reference/numpysupported.html.
Any advantage over that here?

@mmcky
Copy link
Contributor Author

mmcky commented Mar 4, 2024

np.interp is available through Numba: see https://numba.pydata.org/numba-doc/dev/reference/numpysupported.html. Any advantage over that here?

thanks @oyamad probably not -- i didn't realise it was supported.

As we have decided to revert the order of arguments to match the numpy order we should use the numba built-in.

@mmcky
Copy link
Contributor Author

mmcky commented Mar 4, 2024

cc @jstac

@jstac
Copy link
Contributor

jstac commented Mar 4, 2024

Thanks @mmcky heading to the hospital now.

@mmcky
Copy link
Contributor Author

mmcky commented Mar 4, 2024

Thanks @mmcky heading to the hospital now.

Hope all goes well. Thanks @jstac

@jstac
Copy link
Contributor

jstac commented Mar 4, 2024

Thanks @oyamad .

Sorry @mmcky , my bad. perhaps we can test if swapping for the numpy version degrades performance or causes any issues in one or two lectures that are currently using jitted functions plus the version from interpolation. If all is good we can close this PR and swap every 1d interp to the numpy version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants