f0uriest / interpax

Interpolation and function approximation with JAX
MIT License
137 stars 11 forks source link

Allenw/interp scalars #12

Closed allen-adastra closed 1 year ago

allen-adastra commented 1 year ago

Add support for scalar query points.

This isn't the most elegant way of going about it, would welcome other ideas.

I will note that currently on main, if I input a scalar as a 1d array, we fail the jax.grad test it seems.

Also increase jax version range up to 0.4.20.

f0uriest commented 1 year ago

Thanks for the PR! My bad for not checking for scalar inputs :sleeping:

Looks like the tests are failing due to some deprecation warnings in newer versions of JAX, can you take a look? Also looks like some formatting/linting issues, pre-commit (yml file https://github.com/f0uriest/interpax/blob/main/.pre-commit-config.yaml) should take care of it.

allen-adastra commented 1 year ago

Thanks for making this package! Def something that is sorely needed.

Sorted out the deprecation matter and ran the pre-commit (whoops, didn't install).

I also recently tried this new linter/formatter that has been exploding in popularity. Will say it's been a good move for me: https://github.com/astral-sh/ruff

codecov-commenter commented 1 year ago

Codecov Report

Merging #12 (4bd3f51) into main (c3b1d4c) will increase coverage by 0.01%. The diff coverage is 100.00%.

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #12 +/- ## ========================================== + Coverage 96.81% 96.83% +0.01% ========================================== Files 4 4 Lines 628 631 +3 ========================================== + Hits 608 611 +3 Misses 20 20 ``` | [Files](https://app.codecov.io/gh/f0uriest/interpax/pull/12?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Rory+Conlin) | Coverage Δ | | |---|---|---| | [interpax/\_spline.py](https://app.codecov.io/gh/f0uriest/interpax/pull/12?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Rory+Conlin#diff-aW50ZXJwYXgvX3NwbGluZS5weQ==) | `97.02% <100.00%> (+0.01%)` | :arrow_up: |