Skip to content

Commit 9e3122d

Browse files
authored
Merge pull request #57 from dihm/pyqtgraph_deprecations
Pyqtgraph deprecations
2 parents c0f24a5 + 968248d commit 9e3122d

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

runviewer/__main__.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -934,7 +934,7 @@ def update_plots(self):
934934
if shot not in self.plot_items[channel]:
935935
# plot_item = self.plot_widgets[channel].plot(shot.traces[channel][0], shot.traces[channel][1], pen=pg.mkPen(QColor(colour), width=2))
936936
# Add empty plot as it the custom resampling we do will happen quicker if we don't attempt to first plot all of the data
937-
plot_item = self.plot_widgets[channel].plot([0, 0], [0], pen=pg.mkPen(QColor(colour), width=2), stepMode=True)
937+
plot_item = self.plot_widgets[channel].plot([0, 0], [0], pen=pg.mkPen(QColor(colour), width=2), stepMode='center')
938938
self.plot_items[channel][shot] = plot_item
939939

940940
# Add Shutter Markers of newly ticked Shots
@@ -979,7 +979,7 @@ def create_plot(self, channel, ticked_shots):
979979
if channel in shot.traces:
980980
# plot_item = self.plot_widgets[channel].plot(shot.traces[channel][0], shot.traces[channel][1], pen=pg.mkPen(QColor(colour), width=2))
981981
# Add empty plot as it the custom resampling we do will happen quicker if we don't attempt to first plot all of the data
982-
plot_item = self.plot_widgets[channel].plot([0, 0], [0], pen=pg.mkPen(QColor(colour), width=2), stepMode=True)
982+
plot_item = self.plot_widgets[channel].plot([0, 0], [0], pen=pg.mkPen(QColor(colour), width=2), stepMode='center')
983983
self.plot_items[channel][shot] = plot_item
984984

985985
if len(shot.traces[channel]) == 3:
@@ -1106,7 +1106,7 @@ def __resample4(self, x_in, y_in, x_out, y_out, stop_time):
11061106
# i += 1
11071107

11081108
# Get values until we get to the end of the data:
1109-
while j < len(x_in) and i < len(x_out) - 2: # Leave one spare for the final data point and one because stepMode=True requires len(y)=len(x)-1
1109+
while j < len(x_in) and i < len(x_out) - 2: # Leave one spare for the final data point and one because stepMode='center' requires len(y)=len(x)-1
11101110
# This is 'nearest neighbour on the left' interpolation. It's
11111111
# what we want if none of the source values checked in the
11121112
# upcoming loop are used:
@@ -1264,7 +1264,7 @@ def __pool_resample(self, channel, shot, colour, xmin, xmax, dx):
12641264
xnew, ynew = self.resample(shot.scaled_times(channel), shot.traces[channel][1], xmin, xmax, shot.stop_time, dx)
12651265
else:
12661266
xnew, ynew = self.resample(shot.traces[channel][0], shot.traces[channel][1], xmin, xmax, shot.stop_time, dx)
1267-
return inmain_later(self.plot_items[channel][shot].setData, xnew, ynew, pen=pg.mkPen(QColor(colour), width=2), stepMode=True)
1267+
return inmain_later(self.plot_items[channel][shot].setData, xnew, ynew, pen=pg.mkPen(QColor(colour), width=2), stepMode='center')
12681268
except Exception:
12691269
#self._resample = True
12701270
pass

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ install_requires =
3232
importlib_metadata
3333
labscript_utils>=3.1.0b1
3434
labscript-c-extensions
35-
pyqtgraph>=0.11.0rc0
35+
pyqtgraph>=0.11.1
3636
qtutils>=2.0.0
3737
zprocess
3838
numpy>=1.15

0 commit comments

Comments
 (0)