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

Fix deprecation warnings from importlib and numpy #361

Merged
merged 1 commit into from
Nov 27, 2024

Conversation

bmorris3
Copy link
Contributor

@bmorris3 bmorris3 commented Nov 27, 2024

This PR fixes a few deprecation warnings:

  1. Replaces the deprecated importlib.resources.path method with the new files() API

  2. Drops the 1 in numpy.random.rand(1), and calls squeeze to resolve a similar issue where length-one vectors are being made where the result is expected to be scalar, since numpy 1.25:

DeprecationWarning: Conversion of an array with ndim > 0 to a scalar is deprecated, 
and will error in future. Ensure you extract a single element from your array 
before performing this operation. (Deprecated NumPy 1.25.)

Closes #360

Copy link
Collaborator

@mfixstsci mfixstsci left a comment

Choose a reason for hiding this comment

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

Changes look good! Thank you for the test as well @bmorris3 🤝

@mfixstsci mfixstsci merged commit 0834e98 into spacetelescope:main Nov 27, 2024
5 checks 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.

deprecated call to importlib_resources.path causing downstream test failures
2 participants