Commit 6ae4d88d authored by Jameson Graef Rollins's avatar Jameson Graef Rollins
Browse files

more type conversion fixes for yaml export

parent 3fc2efca
...@@ -224,10 +224,11 @@ DATA_EXPORT_FUNCTIONS = { ...@@ -224,10 +224,11 @@ DATA_EXPORT_FUNCTIONS = {
# TEMPLATE # TEMPLATE
def export_layout_yaml(plotdict, path, bw=False, window_title=None, window_size=None, font_size=10): def export_layout_yaml(plotdict, path, bw=False, window_title=None, time_window=None, font_size=10):
template = {} template = {}
template['black-on-white'] = bw template['black-on-white'] = bw
template['time-window'] = window_size # convert to float from numpy.float64
template['time-window'] = list(map(float, time_window))
template['font-size'] = font_size template['font-size'] = font_size
plots = [] plots = []
for plot, cells in plotdict.items(): for plot, cells in plotdict.items():
...@@ -243,7 +244,7 @@ def export_layout_yaml(plotdict, path, bw=False, window_title=None, window_size= ...@@ -243,7 +244,7 @@ def export_layout_yaml(plotdict, path, bw=False, window_title=None, window_size=
plot_item['yrange'] = 'auto' plot_item['yrange'] = 'auto'
else: else:
# convert to float from numpy.float64 # convert to float from numpy.float64
plot_item['yrange'] = [float(y) for y in plot.vb.viewRange()[1]] plot_item['yrange'] = list(map(float, plot.vb.viewRange()[1]))
plots.append(plot_item) plots.append(plot_item)
template['plots'] = plots template['plots'] = plots
template['window-title'] = window_title template['window-title'] = window_title
......
...@@ -1256,7 +1256,7 @@ class NDScope(QMainWindow, Ui_MainWindow): ...@@ -1256,7 +1256,7 @@ class NDScope(QMainWindow, Ui_MainWindow):
kwargs = dict( kwargs = dict(
bw=(self.backgroundCheckBox.checkState() == QtCore.Qt.Checked), bw=(self.backgroundCheckBox.checkState() == QtCore.Qt.Checked),
window_title=self.windowTitle().replace('ndscope: ', ''), window_title=self.windowTitle().replace('ndscope: ', ''),
window_size=self.get_window(), time_window=self.get_window(),
font_size=self.font.pointSize(), font_size=self.font.pointSize(),
) )
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment