Skip to content

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

Merged
billbrod merged 1 commit intomainfrom
fix_warnings
Apr 2, 2025
Merged

switch almost all np.array to np.asarray#44
billbrod merged 1 commit intomainfrom
fix_warnings

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