-
Notifications
You must be signed in to change notification settings - Fork 35
chore: rm support for Python 3.9 + bump Numba #653
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
base: main
Are you sure you want to change the base?
Conversation
c5983dc to
7a16de2
Compare
| @numba.extending.overload(numpy.nan_to_num) # FIXME: This needs to go into Numba! | ||
| def nan_to_num(x, copy=True, nan=0.0, posinf=None, neginf=None): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added this to Numba a while back
| def _getitem( | ||
| array: VectorNumpy2D | VectorNumpy3D | VectorNumpy4D, | ||
| array: VectorNumpy2D | ||
| | VectorNumpy3D | ||
| | VectorNumpy4D | ||
| | AzimuthalNumpyRhoPhi | ||
| | AzimuthalNumpyXY | ||
| | LongitudinalNumpyZ | ||
| | LongitudinalNumpyTheta | ||
| | LongitudinalNumpyEta | ||
| | TemporalNumpyT | ||
| | TemporalNumpyTau, | ||
| where: typing.Any, | ||
| is_momentum: bool, | ||
| ) -> float | FloatArray: | ||
| ) -> float | FloatArray | VectorProtocol | Azimuthal | Longitudinal | Temporal: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This also implements __getitem__ for NumPy coordinate types. Updating the type signature allowed me to remove a few type: ignore[arg-type] comments in the function body.
| def __getitem__( | ||
| self, where: int | ||
| ) -> VectorProtocol | Azimuthal | Longitudinal | Temporal: ... | ||
|
|
||
| @typing.overload | ||
| def __getitem__( | ||
| self, where: typing.Any | ||
| ) -> float | FloatArray | VectorProtocol | Azimuthal | Longitudinal | Temporal: ... | ||
|
|
||
| def __getitem__(self, where: typing.Any) -> float | FloatArray: | ||
| def __getitem__( | ||
| self, where: typing.Any | ||
| ) -> float | FloatArray | VectorProtocol | Azimuthal | Longitudinal | Temporal: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated overloads as per the updates to the actual function (see above)
|
|
||
|
|
||
| class MomentumNumpy2D(PlanarMomentum, VectorNumpy2D): | ||
| class MomentumNumpy2D(PlanarMomentum, VectorNumpy2D): # type: ignore[misc] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The type: ignore[misc] comments were already present in VectorNumpy*D definitions, but now they are also required for Momentum classes.
|
@henryiii, @pfackeldey, could you please take a look whenever you are free (after the holidays 🎄)? Thanks! |
|
I was actually just looking into making a PR to drop 3.9 so it's good to see that this was already done. I was gonna add 3.14 testing though since I noticed that the ci matrix does not test against 3.14. Do you wanna do it in this PR or should I open a separate one? |
|
You would need to change a test for 3.14 support. I'm attempting to run the vector tests with 3.14 here scikit-hep/integration-tests#14 and I'm hitting this. |
|
Ooh, I think we somehow missed that, thanks, @ikrommyd! I can quickly create a new PR to fix this. |
* be explicit about zip being strict * update syntax * type ignore numpy ufunc calls for object and sympy vectors * fix getitem signature for numpy vectors and coordinate classes
460b386 to
acc68c4
Compare
Thanks! If you don't have time and want me to do it, let me know. For awkward, we treated numba refcount differences like this in 3.14: https://github.com/scikit-hep/awkward/pull/3757/changes |
Description
Fixes #600
Fixes #641
Removes Python 3.9 support:
Bumps the minimum Numba version (supported from Python 3.9):
nan_to_numdefinitionChecklist
$ pre-commit run --all-filesor$ nox -s lint)$ pytestor$ nox -s tests)$ cd docs; make clean; make htmlor$ nox -s docs)$ pytest --doctest-plus src/vector/or$ nox -s doctests)Before Merging