Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

MNT: Update basic units example to work with numpy 2.0#28441

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
rcomer merged 1 commit intomatplotlib:mainfromgreglucas:np2-fix-units
Jun 24, 2024

Conversation

greglucas
Copy link
Contributor

PR summary

We are getting reviewdog failures in the galleries/examples tests with numpy 2.0. There are new keyword arguments required forarray andarray_wrap that are expected in numpy 2.0.

From the release noteshttps://numpy.org/devdocs/release/2.0.0-notes.html

array_wrap is now passed arr, context, return_scalar and support for implementations not accepting all three are deprecated. Its signature should bearray_wrap(self, arr, context=None, return_scalar=False)

https://numpy.org/devdocs/release/2.0.0-notes.html#the-array-special-method-now-takes-a-copy-keyword-argument

NumPy will pass copy to thearray special method in situations where it would be set to a non-default value (e.g. in a call to np.asarray(some_object, copy=False)). Currently, if an unexpected keyword argument error is raised after this, NumPy will print a warning and re-try without the copy keyword argument. Implementations of objects implementing thearray protocol should accept a copy keyword argument with the same meaning as when passed tonumpy.array ornumpy.asarray.

PR checklist

There are new keyword arguments required for __array__ and__array_wrap__ that are expected in numpy 2.0.
@github-actionsgithub-actionsbot added the Documentation: examplesfiles in galleries/examples labelJun 23, 2024
Copy link
Member

@story645story645 left a comment
edited
Loading

Choose a reason for hiding this comment

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

I think this is probably overly complicated as a "how to make units" example, but also thanks for fixing this.

Can merge on tests passing.

@rcomerrcomer merged commite243b2c intomatplotlib:mainJun 24, 2024
25 checks passed
@rcomerrcomer added this to thev3.9.1 milestoneJun 24, 2024
@rcomer
Copy link
Member

@meeseeksdev backport to v3.9.x

meeseeksmachine pushed a commit to meeseeksmachine/matplotlib that referenced this pull requestJun 24, 2024
rcomer added a commit that referenced this pull requestJun 24, 2024
…441-on-v3.9.xBackport PR#28441 on branch v3.9.x (MNT: Update basic units example to work with numpy 2.0)
@greglucasgreglucas deleted the np2-fix-units branchJune 24, 2024 13:25
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@story645story645story645 approved these changes

Assignees
No one assigned
Labels
Documentation: examplesfiles in galleries/examplesMaintenance
Projects
None yet
Milestone
v3.9.1
Development

Successfully merging this pull request may close these issues.

3 participants
@greglucas@rcomer@story645

[8]ページ先頭

©2009-2025 Movatter.jp