Skip to content

fix: numpy 2 prefers asarray() instead of copy=False #2488

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
May 6, 2025

Conversation

reneleonhardt
Copy link
Contributor

I read in an issue that in some cases np.array(copy=False) fails: #2479 (comment)
It's recommended to migrate to np.asarray() (without copy):
https://numpy.org/devdocs/numpy_2_0_migration_guide.html#adapting-to-changes-in-the-copy-keyword

Copy link
Collaborator

@jakesabathia2 jakesabathia2 left a comment

Choose a reason for hiding this comment

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

@reneleonhardt
Copy link
Contributor Author

You're welcome! Everything was green, can you see if there were unexpected performance regressions?

@reneleonhardt
Copy link
Contributor Author

By the way, if speed (of your builds) is a concern to you, maybe you could look into https://codspeed.io it's free for Open-Source projects: https://docs.codspeed.io/integrations/ci/gitlab-ci

@reneleonhardt
Copy link
Contributor Author

@jakesabathia2 Is there something missing?
CodeRabbit could help speed up your review process 😄
https://github.com/coderabbitai/awesome-coderabbit

@jakesabathia2
Copy link
Collaborator

@reneleonhardt your PR looks good to me. Let me merge it. Thanks!

@jakesabathia2 jakesabathia2 self-requested a review May 6, 2025 18:32
@jakesabathia2 jakesabathia2 merged commit 07ccab3 into apple:main May 6, 2025
@reneleonhardt reneleonhardt deleted the fix/numpy2-asarray branch May 6, 2025 19:15
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