From 3d15ca1038afb34b4de32dfb82c5ff89c8067516 Mon Sep 17 00:00:00 2001 From: Nathan Jessurun Date: Thu, 5 Aug 2021 15:28:05 -0400 Subject: [PATCH] Catch remaining 'values' usages --- examples/PlotSpeedTest.py | 4 ++-- examples/ScatterPlotSpeedTest.py | 2 +- examples/relativity/relativity.py | 6 +++--- pyqtgraph/widgets/ColorMapWidget.py | 6 +++--- pyqtgraph/widgets/DataFilterWidget.py | 2 +- tests/parametertree/test_parametertypes.py | 8 ++++---- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/examples/PlotSpeedTest.py b/examples/PlotSpeedTest.py index 2f233f31..af6e3e97 100644 --- a/examples/PlotSpeedTest.py +++ b/examples/PlotSpeedTest.py @@ -115,9 +115,9 @@ children = [ dict(name='enableExperimental', type='bool', value=pg.getConfigOption('enableExperimental')), dict(name='pen', type='pen', value=default_pen), dict(name='antialias', type='bool', value=pg.getConfigOption('antialias')), - dict(name='connect', type='list', values=['all', 'pairs', 'finite', 'array'], value='all'), + dict(name='connect', type='list', limits=['all', 'pairs', 'finite', 'array'], value='all'), dict(name='skipFiniteCheck', type='bool', value=False), - dict(name='plotMethod', title='Plot Method', type='list', values=['pyqtgraph', 'drawPolyline', 'drawLines']) + dict(name='plotMethod', title='Plot Method', type='list', limits=['pyqtgraph', 'drawPolyline', 'drawLines']) ] params = ptree.Parameter.create(name='Parameters', type='group', children=children) diff --git a/examples/ScatterPlotSpeedTest.py b/examples/ScatterPlotSpeedTest.py index 3ce8a6eb..eb0a100c 100644 --- a/examples/ScatterPlotSpeedTest.py +++ b/examples/ScatterPlotSpeedTest.py @@ -26,7 +26,7 @@ param = ptree.Parameter.create(name=translate('ScatterPlot', 'Parameters'), type dict(name='randomize', title=translate('ScatterPlot', 'Randomize: '), type='bool', value=False), dict(name='pxMode', title='pxMode: ', type='bool', value=True), dict(name='useCache', title='useCache: ', type='bool', value=True), - dict(name='mode', title=translate('ScatterPlot', 'Mode: '), type='list', values={translate('ScatterPlot', 'New Item'): 'newItem', translate('ScatterPlot', 'Reuse Item'): 'reuseItem', translate('ScatterPlot', 'Simulate Pan/Zoom'): 'panZoom', translate('ScatterPlot', 'Simulate Hover'): 'hover'}, value='reuseItem'), + dict(name='mode', title=translate('ScatterPlot', 'Mode: '), type='list', limits={translate('ScatterPlot', 'New Item'): 'newItem', translate('ScatterPlot', 'Reuse Item'): 'reuseItem', translate('ScatterPlot', 'Simulate Pan/Zoom'): 'panZoom', translate('ScatterPlot', 'Simulate Hover'): 'hover'}, value='reuseItem'), ]) for c in param.children(): c.setDefault(c.value()) diff --git a/examples/relativity/relativity.py b/examples/relativity/relativity.py index 62a78e40..2d3c2894 100644 --- a/examples/relativity/relativity.py +++ b/examples/relativity/relativity.py @@ -27,10 +27,10 @@ class RelativityGUI(QtGui.QWidget): self.objectGroup = ObjectGroupParam() self.params = Parameter.create(name='params', type='group', children=[ - dict(name='Load Preset..', type='list', values=[]), - #dict(name='Unit System', type='list', values=['', 'MKS']), + dict(name='Load Preset..', type='list', limits=[]), + #dict(name='Unit System', type='list', limits=['', 'MKS']), dict(name='Duration', type='float', value=10.0, step=0.1, limits=[0.1, None]), - dict(name='Reference Frame', type='list', values=[]), + dict(name='Reference Frame', type='list', limits=[]), dict(name='Animate', type='bool', value=True), dict(name='Animation Speed', type='float', value=1.0, dec=True, step=0.1, limits=[0.0001, None]), dict(name='Recalculate Worldlines', type='action'), diff --git a/pyqtgraph/widgets/ColorMapWidget.py b/pyqtgraph/widgets/ColorMapWidget.py index affe9b6b..61083ee3 100644 --- a/pyqtgraph/widgets/ColorMapWidget.py +++ b/pyqtgraph/widgets/ColorMapWidget.py @@ -194,10 +194,10 @@ class RangeColorMapItem(ptree.types.SimpleParameter): ptree.types.SimpleParameter.__init__(self, name=name, autoIncrementName=True, type='colormap', removable=True, renamable=True, children=[ - #dict(name="Field", type='list', value=name, values=fields), + #dict(name="Field", type='list', value=name, limits=fields), dict(name='Min', type='float', value=0.0, suffix=units, siPrefix=True), dict(name='Max', type='float', value=1.0, suffix=units, siPrefix=True), - dict(name='Operation', type='list', value='Overlay', values=['Overlay', 'Add', 'Multiply', 'Set']), + dict(name='Operation', type='list', value='Overlay', limits=['Overlay', 'Add', 'Multiply', 'Set']), dict(name='Channels..', type='group', expanded=False, children=[ dict(name='Red', type='bool', value=True), dict(name='Green', type='bool', value=True), @@ -240,7 +240,7 @@ class EnumColorMapItem(ptree.types.GroupParameter): name=name, autoIncrementName=True, removable=True, renamable=True, children=[ dict(name='Values', type='group', children=childs), - dict(name='Operation', type='list', value='Overlay', values=['Overlay', 'Add', 'Multiply', 'Set']), + dict(name='Operation', type='list', value='Overlay', limits=['Overlay', 'Add', 'Multiply', 'Set']), dict(name='Channels..', type='group', expanded=False, children=[ dict(name='Red', type='bool', value=True), dict(name='Green', type='bool', value=True), diff --git a/pyqtgraph/widgets/DataFilterWidget.py b/pyqtgraph/widgets/DataFilterWidget.py index 0288cc3a..4af3804d 100644 --- a/pyqtgraph/widgets/DataFilterWidget.py +++ b/pyqtgraph/widgets/DataFilterWidget.py @@ -130,7 +130,7 @@ class RangeFilterItem(ptree.types.SimpleParameter): ptree.types.SimpleParameter.__init__(self, name=name, autoIncrementName=True, type='bool', value=True, removable=True, renamable=True, children=[ - #dict(name="Field", type='list', value=name, values=fields), + #dict(name="Field", type='list', value=name, limits=fields), dict(name='Min', type='float', value=0.0, suffix=units, siPrefix=True), dict(name='Max', type='float', value=1.0, suffix=units, siPrefix=True), ]) diff --git a/tests/parametertree/test_parametertypes.py b/tests/parametertree/test_parametertypes.py index a5c2ea6c..d7100b58 100644 --- a/tests/parametertree/test_parametertypes.py +++ b/tests/parametertree/test_parametertypes.py @@ -31,8 +31,8 @@ def test_types(): dict(name='float', type='float'), dict(name='int', type='int'), dict(name='str', type='str'), - dict(name='list', type='list', values=['x','y','z']), - dict(name='dict', type='list', values={'x':1, 'y':3, 'z':7}), + dict(name='list', type='list', limits=['x','y','z']), + dict(name='dict', type='list', limits={'x':1, 'y':3, 'z':7}), dict(name='bool', type='bool'), dict(name='color', type='color'), ] @@ -129,8 +129,8 @@ def test_limits_enforcement(): p = pt.Parameter.create(name='params', type='group', children=[ dict(name='float', type='float', limits=[0, 1]), dict(name='int', type='int', bounds=[0, 1]), - dict(name='list', type='list', values=['x', 'y']), - dict(name='dict', type='list', values={'x': 1, 'y': 2}), + dict(name='list', type='list', limits=['x', 'y']), + dict(name='dict', type='list', limits={'x': 1, 'y': 2}), ]) t = pt.ParameterTree() t.setParameters(p)