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

Fix imshow to work with subclasses of ndarray.#18286

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
dstansby merged 3 commits intomatplotlib:masterfroml-johnston:issue_18077
Aug 22, 2020
Merged

Fix imshow to work with subclasses of ndarray.#18286

dstansby merged 3 commits intomatplotlib:masterfroml-johnston:issue_18077
Aug 22, 2020

Conversation

l-johnston
Copy link
Contributor

@l-johnstonl-johnston commentedAug 18, 2020
edited
Loading

PR Summary

Closes#18077

In the internals of _ImageBase._make_image, the clip bounds arithmetic fails with ndarray subclasses that support masked arrays such asunyt.

PR Checklist

  • Code isFlake 8 compliant
  • Code has test coverage

Copy link
Member

@jklymakjklymak left a comment

Choose a reason for hiding this comment

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

Seems right - OTOH do you have a test?

@jklymakjklymak added this to thev3.4.0 milestoneAug 18, 2020
@l-johnston
Copy link
ContributorAuthor

I took a look at matplotlib'sQuantity defined in test_units.py, but it doesn't have all the ndarray featuresunyt has that are needed to test the fix. And I didn't want to importunyt.

@jklymakjklymak changed the titleFix imshow to work with subclasses of ndarray. Fix #18077Fix imshow to work with subclasses of ndarray.Aug 18, 2020
@jklymak
Copy link
Member

(Please don't put the issue in title, but yes, please do put issue in description!)

@l-johnston
Copy link
ContributorAuthor

I might be able to implement a skeleton ndarray subclass with just enough features to reproduce the bug and then test the fix. Is this of interest?

@dopplershift
Copy link
Contributor

dopplershift commentedAug 18, 2020
edited
Loading

If it's a huge amount of effort, I think it would be worthwhile. That should have said: "If it's NOT a huge amount of effort, I think it would be worthwhile."

@l-johnston
Copy link
ContributorAuthor

@dopplershift I implemented the skeleton ndarray subclass that reproduces the bug and validates the fix. Is this sufficient?

Copy link
Contributor

@dopplershiftdopplershift left a comment

Choose a reason for hiding this comment

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

That seems fine to me.

There is a slight question as to whether this should go intotest_units.py (see#18278), but I'm not holding this up for that.

@dstansbydstansby merged commit48b6327 intomatplotlib:masterAug 22, 2020
@dstansby
Copy link
Member

Thoughts on backporting to 3.3.x as a bugfix?

@neutrinoceros
Copy link
Contributor

Thanks for fixing this !

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@dopplershiftdopplershiftdopplershift approved these changes

@dstansbydstansbydstansby approved these changes

@jklymakjklymakAwaiting requested review from jklymak

Assignees
No one assigned
Projects
None yet
Milestone
v3.4.0
Development

Successfully merging this pull request may close these issues.

Imshow breaks if given a unyt_array input
5 participants
@l-johnston@jklymak@dopplershift@dstansby@neutrinoceros

[8]ページ先頭

©2009-2025 Movatter.jp