-
Notifications
You must be signed in to change notification settings - Fork 82
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
Numpy 2.0 #689
base: main
Are you sure you want to change the base?
Conversation
28bb96a
to
2808634
Compare
Removed the custom Complex C types... I have no context as to why they were necessary, so that definitely needs careful review. This is code that seems to have been there mostly from the beginning. Edit seems to be needed to define operations like |
d83b37d
to
eca375b
Compare
Also removes special case for old unsupported numpy 1.16
In what context? If it is in array indexing, then this syntax was only added on Python 3.11 (I found out recently about this). |
No, this is C(++) code, multiplication of complex scalars. Maybe @michaelosthege finds this interesting xD? These are the breaking changes: https://numpy.org/devdocs/numpy_2_0_migration_guide.html#complex-types-underlying-type-changes |
This will help with publishing a repodata patch for conda-forge as per <pymc-devs#688 (comment)>. This will no longer be necessary when we are finished with <pymc-devs#689>.
This will help with publishing a repodata patch for conda-forge as per <#688 (comment)>. This will no longer be necessary when we are finished with <#689>.
Friendly note that it will be necessary to revert 1235d08 on the next rebase in order to unpin |
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.
No, this is C(++) code, multiplication of complex scalars.
Maybe @michaelosthege finds this interesting xD?
These are the breaking changes: https://numpy.org/devdocs/numpy_2_0_migration_guide.html#complex-types-underlying-type-changes
I don't usually write C, but when I do it's for EPS32 microcontrollers, so I have zero clue about this NumPy C stuff 😄
@@ -3144,7 +2985,7 @@ def L_op(self, inputs, outputs, gout): | |||
else: | |||
return [x.zeros_like()] | |||
|
|||
return (gz * exp2(x) * log(np.cast[x.type](2)),) | |||
return (gz * exp2(x) * log(np.asarray(2, dtype=x.type)),) |
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.
These look like they could be cherry-picked and applied already?
Now with numpy 2.0 released it would be nice to be compatible with it. |
There's some esoteric C++ code for complex variables that I didn't want to dig too much into |
Description
Ruff suggested a few things to change but I cannot test because I install both
numpy=2.0.0.rc1
andnumba
(any version including the most recent0.59.1
) (incompatibilities in python abi).Related Issue
Checklist
Type of change