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

Numpy-related fixes and deprecations #454

Merged
merged 6 commits into from
Dec 29, 2024

Conversation

vnmanoharan
Copy link
Contributor

@vnmanoharan vnmanoharan commented Dec 26, 2024

Per #435, we are targeting numpy 1.20.3 for HoloPy 3.6. This PR fixes some code that uses numpy constructs that will not work in later numpy versions (>1.20.3) . These fixes will allow us to more easily transition to numpy version 2 in later versions of HoloPy.

This PR also deprecates passing the name argument to a numpy ufunc to create a TransformedPrior, a feature that was added in HoloPy 3.5. Unfortunately, versions of numpy >1.20.3 have added argument validation for ufuncs, so that trying to create a TranformedPrior object by doing, for example, transformed = np.sqrt(prior_1, name=new_name) will fail on these later numpy versions with a TypeError. A DeprecationWarning is now issued, and the feature will be removed in HoloPy 3.7. Documentation has been updated to no longer discuss this feature, and a test has been added to check for the DeprecationWarning.

@pep8speaks
Copy link

pep8speaks commented Dec 26, 2024

Hello @vnmanoharan! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻

Comment last updated at 2024-12-26 23:25:23 UTC

@vnmanoharan vnmanoharan added this to the 3.6 milestone Dec 26, 2024
@vnmanoharan vnmanoharan merged commit 32886fa into manoharan-lab:develop Dec 29, 2024
1 check passed
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.

3 participants