piker icon indicating copy to clipboard operation
piker copied to clipboard

Syncing with `pyqtgraph` upstream

Open goodboy opened this issue 3 years ago • 0 comments

There's been a bunch of enhancements and extensions built as part of this project and it's likely that users of pyqtgraph might eventually want these additions in core at some point. Likely this will be a task more conducive to a modernized upstream code base (eg. type annots, py3.10+, linting on core graphics modules) and likely a full adoption of numba (which maybe is true already?).


2D real-time graphics performance

  • use of numba, numpy array caching, the m4 downsampling algorithm, QPainterPath pre/append for update, and use of QGraphicsObject.setCacheMode() to massively speed up real-time updated QPainterPath implemented charts. More or less the reverse chronological set of features was:

    • https://github.com/pikers/piker/pull/302 which added use of the m4 graphics downsampling algo and sets our official benchmark for insanely fast massive data viz 😎 :
      • [ ] faster auto-y-range work in https://github.com/pikers/piker/pull/342 with follow ups:
        • [ ] https://github.com/pikers/piker/issues/325
        • [ ] https://github.com/pikers/piker/issues/343
      • [ ] https://github.com/pikers/piker/issues/324
    • https://github.com/pikers/piker/pull/289
    • https://github.com/pikers/piker/pull/240 (for faster bar-style charting)
    • https://github.com/pikers/piker/pull/134
    • https://github.com/pikers/piker/pull/130
  • AxisItem lru caching of tick values and a new PlotItem.removeAxis() method were part of a series of patches detailed by and factored into piker in https://github.com/pikers/piker/pull/413 which originally had an upstream submission in https://github.com/pyqtgraph/pyqtgraph/pull/2160


UI / UX extensions

  • Overlayed PlotItem view boxes and tiled axes originally proposed in https://github.com/pyqtgraph/pyqtgraph/pull/1359 and put to use from our independent implementation originally proposed in https://github.com/pyqtgraph/pyqtgraph/pull/2162, broken out into piker in https://github.com/pikers/piker/pull/257 and put to use in https://github.com/pikers/piker/pull/259. Finally, a more final version of the PlotItem overlay system/API landed in #415.

    The upstream todo list for this is approx:

    • [ ] maybe make a replacement PR to pyqtgraph for https://github.com/pyqtgraph/pyqtgraph/pull/1359 but as an alternative to our original approach in https://github.com/pyqtgraph/pyqtgraph/pull/2162
    • [ ] replicate all features demonstrated in the #1359 example https://github.com/pyqtgraph/pyqtgraph/pull/1359/files#diff-94dc9b2e38ec700e3655ccced14e2c3784b4c278f9195aff9982232b7473b289
      • [ ] pretty sure the only outstanding is label stacking from added PlotItem axes?
    • [ ] submit our updated ._plotitemoverlay.py (or where does core want this put?) and example showing use of link_axes: tuple[int] vs. relay_events: list[str]
      • talk to pyqtgraph core peeps about this work if they even want it...
    • [ ] reference the MultiplePlotAxes example and include a detailed write-up on the details of ViewBox.linkView() vs. our new event broadcasting (eg. how you can run into issues with double handling of mouseDragEvent)

    Further interesting upstream patches that might pertain improving this API include:

    • https://github.com/pyqtgraph/pyqtgraph/pull/2461
  • generalized use of pyqtgraph.LinearRegionItem and index-allignment between multiple data-source-related graphs was added in https://github.com/pikers/piker/pull/395 and refined to a 2-chart helper routine in https://github.com/pikers/piker/pull/401/files#diff-a91cd3e47717faa8e4317892b26b77102bec85a2f00109e0932cf289d5960d62R812

    • [ ] follow up desired features and known bugs in #400

Profiling

We broke out the self-contained pyqtgraph.debug.Profiler into a modified version from https://github.com/pyqtgraph/pyqtgraph/pull/2281 and added it to piker in https://github.com/pikers/piker/commit/1d4fc6f327cd2339c26b7a3c83a61fcc6e405c55

  • [ ] further needed research for choosing a more proper alt is layed out in https://github.com/pikers/piker/issues/337

goodboy avatar Nov 10 '22 17:11 goodboy