Skip to content

fix: use connect='finite' if finite-ness of data is unknown#2471

Merged
j9ac9k merged 1 commit intopyqtgraph:masterfrom
pijyoi:auto-finite
Oct 7, 2022
Merged

fix: use connect='finite' if finite-ness of data is unknown#2471
j9ac9k merged 1 commit intopyqtgraph:masterfrom
pijyoi:auto-finite

Conversation

@pijyoi
Copy link
Copy Markdown
Contributor

@pijyoi pijyoi commented Oct 7, 2022

PlotDataItem defaults to connect='auto'. In the course of its processing, PlotDataItem might perform a finite-ness check on the data for its own purpose.

Given a dataset that contains non-finites,

  1. if this finite-ness check was performed, PlotDataItem switches to using connect='finite'.
  2. if this finite-ness check was not performed, PlotDataItem switches to using connect='all'.

This ends up in a situation where such a dataset is sometimes drawn connected, sometimes drawn disconnected.

This PR changes (2) to use connect='finite'. This causes the underlying PlotCurveItem (via arrayToQPath) to perform its own finite checking.

Test cases can be found in #2456.

Fixes #2456

@j9ac9k
Copy link
Copy Markdown
Member

j9ac9k commented Oct 7, 2022

Thanks @pijyoi as always, love the diff.

Thank you @alanbowman for reporting the issue in the mail list, and subsequently creating #2456 with an example that could be reproduced.

@j9ac9k j9ac9k merged commit b9bafe1 into pyqtgraph:master Oct 7, 2022
@pijyoi pijyoi deleted the auto-finite branch October 7, 2022 19:23
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.

Invalid data incorrectly identified/drawn

2 participants