Skip to content

switch almost all np.array to np.asarray #44

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

Merged
merged 1 commit into from
Apr 2, 2025
Merged

switch almost all np.array to np.asarray #44

merged 1 commit into from
Apr 2, 2025

Conversation

billbrod
Copy link
Member

@billbrod billbrod commented Apr 2, 2025

In general, np.asarray is a better choice than np.array, because np.asarray will avoid copying if it can. In particular, doing this because calling np.array(torch.as_tensor([0,1])) raises a DeprecationWarning, whereas np.asarray does not. And since we call some functionality in pyrtools from plenoptic, want to avoid that.

The only remaining call to np.array is one in SteerablePyramidFreq, where we need to set ndmin.

which is generally the right decision
@billbrod billbrod merged commit c937115 into main Apr 2, 2025
37 checks passed
@billbrod billbrod deleted the fix_warnings branch April 2, 2025 18:00
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.

1 participant