-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow arbitrary transforms #2326
base: master
Are you sure you want to change the base?
Conversation
also add beginnings of docs
necesitates moving some PlotDataItem tests into the PlotItem tests, sorta
Conflicts: pyqtgraph/graphicsItems/PlotDataItem.py - unrelated additions and modifications at the same lines
'fftMode': False, | ||
'logMode': [False, False], | ||
'derivativeMode': False, | ||
'phasemapMode': False, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These opts might be something users depend on? I hope not. Deprecating these would be tricky.
check.toggled.connect(self._handleDataTransformChecked) | ||
check.toggled.emit(False) # registers with all the data items and axes | ||
|
||
# :MC: removeDataTransformOption was left unimplemented. Here are the concerns it will need to cover: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the most glaring shortcoming of this PR; it feels like removing transform options from a particular plot is something users are going to want to do. That said, the notes about why it wasn't included do make for a good starting point if someone decides to add this as a feature later.
PlotItem.addDefaultDataTransformOption( | ||
translate("Form", "dy/dx"), | ||
_diff, | ||
order=60, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This ordering mechanism is a bit sloppy. I wish I had a better idea for it.
Conflicts: pyqtgraph/graphicsItems/PlotItem/PlotItem.py - imports pyqtgraph/graphicsItems/PlotItem/plotConfigTemplate_pyqt5.py - rm v. modify pyqtgraph/graphicsItems/PlotItem/plotConfigTemplate_pyside2.py - rm v. modify pyqtgraph/graphicsItems/PlotItem/plotConfigTemplate_pyside6.py - rm v. modify
I'm setting this aside while we work on a new architecture to better handle non-linear transforms |
@@ -6,7 +6,7 @@ | |||
# run again. Do not edit this file unless you know what you are doing. | |||
|
|||
|
|||
from PyQt6 import QtCore, QtGui, QtWidgets | |||
from ..Qt import QtCore, QtGui, QtWidgets |
Check notice
Code scanning / CodeQL
Unused import Note
@@ -6,7 +6,7 @@ | |||
# run again. Do not edit this file unless you know what you are doing. | |||
|
|||
|
|||
from PyQt6 import QtCore, QtGui, QtWidgets | |||
from ..Qt import QtCore, QtGui, QtWidgets |
Check notice
Code scanning / CodeQL
Unused import Note
pyqtgraph/examples/MultiDataPlot.py
Outdated
|
||
import pyqtgraph as pg | ||
from pyqtgraph.graphicsItems.ScatterPlotItem import name_list | ||
from pyqtgraph.Qt import QtWidgets, QtCore |
Check notice
Code scanning / CodeQL
Unused import Note
pyqtgraph/Qt/internals.py
Outdated
# this is a shallow copy | ||
return self._objs[:self._size] | ||
|
||
def drawargs(self): |
Check notice
Code scanning / CodeQL
Returning tuples with varying lengths Note
tuple of size 1
tuple of size 2
pyqtgraph/exporters/SVGExporter.py
Outdated
profiler = debug.Profiler() | ||
|
||
if options is None: | ||
options = {} |
Check notice
Code scanning / CodeQL
Unused local variable Note
pyqtgraph/exporters/SVGExporter.py
Outdated
# if hasattr(item, 'setExportMode'): | ||
# item.setExportMode(False) |
Check notice
Code scanning / CodeQL
Commented-out code Note
oof, that's quite the git mess 😬 |
Conflicts: pyqtgraph/graphicsItems/PlotDataItem.py - how nonfinite is handled pyqtgraph/graphicsItems/PlotItem/PlotItem.py - boring conflicts pyqtgraph/parametertree/Parameter.py - boring conflicts tests/graphicsItems/test_PlotDataItem.py - deleted test on nonfinites that I got working
b50e221
to
b15b5af
Compare
This PR refactors the existing data transforms (derivative, fft, log, etc.) into a generic data transform API. The old methods are deprecated with no set date to allow for adequate testing of the new architecture.
Included are also 2 examples of more complicated transforms which take parameters.