Merged
Conversation
This adds a shim similar to scipy that sets copy=False in numpy < 2 and copy=None otherwise.
When the input variable ``val`` may be of type np.int32. This forces an implicit casting of ``fval``, and when it is equal to or exceed 2**31, an OverflowError is raised. This explicit casting prevents this error.
arunkannawadi
commented
Mar 21, 2025
beckermr
reviewed
Mar 21, 2025
With numpy<2, bitwise_and does not operate on uint64 dtype objects. Given that the range of fval is within the range of uint32, casting to uint32 suffices. If the input value has more bits, they will be not used anyway regardless of the casting as long as fval is limited to 2**31.
beckermr
reviewed
Mar 21, 2025
arunkannawadi
commented
Mar 21, 2025
Collaborator
|
@esheldon comments here or shall we merge? |
esheldon
approved these changes
Mar 24, 2025
Owner
|
Arun are you still making additions? |
Contributor
Author
|
Nope, I don't have any more to add unless there are requests. Could you also please cut a release after merging this? |
Owner
|
Sure, can you make a comment in CHANGES.txt with a short explanation? |
Contributor
Author
|
I shall, but I also notice that changes from #246 have not made it into a release yet. I will let you comment on that. With that included, would it bump up the minor version, right? (this PR alone should bump the patch version I think) |
Owner
|
I'll add notes for that. I'll do the version bump when I make my changes. |
Owner
|
Thanks Arun and Matt |
Owner
|
v2.4.0 is released |
Contributor
Author
|
Thank you, Erin! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR makes
ngmixcompatible withnumpy>=2andnumpy<2.The recommended method is to replace
np.array(..., copy=False)withnp.asarraylink. However, given the necessity ofndminwhich is not available inasarray, I took the scipy approach here.