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

DM-45545: Fixes for numpy 2 #409

Merged
merged 2 commits into from
Feb 6, 2025
Merged

DM-45545: Fixes for numpy 2 #409

merged 2 commits into from
Feb 6, 2025

Conversation

timj
Copy link
Member

@timj timj commented Jan 28, 2025

@PFLeget there is a problem with numpy 2 and test_computeExPsf.py. The problem seems to be that multivariate_normal is returning very different answers between numpy 1 and 2. The inputs seem to be the same. Also, using the modern RNG APIs leads to breakage even on numpy 1.

@timj timj force-pushed the tickets/DM-45545 branch from b346023 to 9aaa1a5 Compare January 29, 2025 00:37
@timj timj requested a review from erykoff January 31, 2025 21:34
@timj
Copy link
Member Author

timj commented Jan 31, 2025

@erykoff can you please review the python changes? I won't merge until we can sort out the warpedPsf issue.

Copy link
Contributor

@erykoff erykoff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, modulo the warped psf test problem. However, I also noticed a couple numpy deprecation warnings. Are these in scope?

@timj
Copy link
Member Author

timj commented Feb 4, 2025

I don't mind fixing other problems. I see there are still 3 calls to np.random that need fixing in tests that don't actually set a seed at all. Running the tests I don't see a warning other than the one from kht.

I don't think we can fix the np.trapz warnings that are in other packages until we drop numpy 1.x.

Rather than using np.random.seed and using APIs
like np.random.rand, instead create a Generator
and use methods on that.

This changes RNG state and so some test code has
to have the seed adjusted.
@timj timj force-pushed the tickets/DM-45545 branch from c29e57a to 6216145 Compare February 5, 2025 17:05
@timj
Copy link
Member Author

timj commented Feb 5, 2025

I removed the final three calls to np.random.x and squashed the commits that were doing those changes.

@timj timj merged commit 2179890 into main Feb 6, 2025
2 checks passed
@timj timj deleted the tickets/DM-45545 branch February 6, 2025 16:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants