Skip to content

ImageItem: cache nan check#2784

Merged
j9ac9k merged 1 commit intopyqtgraph:masterfrom
pijyoi:check-nans-once
Aug 12, 2023
Merged

ImageItem: cache nan check#2784
j9ac9k merged 1 commit intopyqtgraph:masterfrom
pijyoi:check-nans-once

Conversation

@pijyoi
Copy link
Copy Markdown
Contributor

@pijyoi pijyoi commented Jul 28, 2023

While adjusting an ImageItem's levels interactively with HistogramLUTItem or ColorBarItem, it is a waste to check for nans each time the same image data gets re-rendered.
(Arguably, checking it even once is a waste, since the common case is that there are no nans.)

The example in #2779 (comment) can be used to show that this PR gives a good speedup.

@j9ac9k
Copy link
Copy Markdown
Member

j9ac9k commented Aug 12, 2023

Thanks for the PR @pijyoi

While there is a common case of no NaNs, NaNs have slipped into this library in a number of places I would not expect, the library should be able to behave in a predictable fashion if that's happening.

@j9ac9k j9ac9k merged commit 47762a7 into pyqtgraph:master Aug 12, 2023
@pijyoi pijyoi deleted the check-nans-once branch August 13, 2023 09:32
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.

2 participants