Skip to content

fix segmented line mode with no segments#2481

Merged
j9ac9k merged 2 commits intopyqtgraph:masterfrom
pijyoi:fix-early-no-segments
Oct 11, 2022
Merged

fix segmented line mode with no segments#2481
j9ac9k merged 2 commits intopyqtgraph:masterfrom
pijyoi:fix-early-no-segments

Conversation

@pijyoi
Copy link
Copy Markdown
Contributor

@pijyoi pijyoi commented Oct 11, 2022

The bug occurs under both PyQt and PySide. It was introduced in aac73a8 when adding support for the (potential) array form of drawLines() under PySide6. In that commit, arrayToLineSegments was modified to return a one or two element tuple. The early return codepath in the function was not similarly modified to return a tuple.

This early return codepath would be triggered by a dataset of length one. A length zero dataset would exit even earlier and thus not trigger this bug.

How to trigger the bug:

  1. Run PlotSpeedTest.py
  2. set nsamples=1
  3. set Width=2

Fixes #2479

@j9ac9k
Copy link
Copy Markdown
Member

j9ac9k commented Oct 11, 2022

Oooof

@pijyoi thanks for the fix. Should a test case be added to catch this?

@pijyoi
Copy link
Copy Markdown
Contributor Author

pijyoi commented Oct 11, 2022

Should a test case be added to catch this?

There goes my 1-char PR...

@j9ac9k
Copy link
Copy Markdown
Member

j9ac9k commented Oct 11, 2022 via email

@j9ac9k
Copy link
Copy Markdown
Member

j9ac9k commented Oct 11, 2022

Thanks for jumping on this @pijyoi

Should probably release 0.13.2 before long with this fix...

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.

TypeError in PlotCurveItem.py: arguments did not match any overloaded call

2 participants