Skip to content

Commit 8c50661

Browse files
committedFeb 8, 2016
Merged in monashkrb/lyse (pull request labscript-suite#3)
Fixes labscript-suite#16 and labscript-suite#17
2 parents 68c69ee + a33189d commit 8c50661

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed
 

‎__init__.py

-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ def data(filepath=None, host='localhost', timeout=5):
5555
else:
5656
port = 42519
5757
df = zmq_get(port, host, 'get dataframe', timeout)
58-
df = df.convert_objects(convert_numeric=True, convert_dates=False)
5958
try:
6059
padding = ('',)*(df.columns.nlevels - 1)
6160
df.set_index([('sequence',) + padding,('run time',) + padding], inplace=True, drop=False)

‎__main__.py

+12-3
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,16 @@ def handler(self, request_data):
169169
if request_data == 'hello':
170170
return 'hello'
171171
elif request_data == 'get dataframe':
172-
return app.filebox.shots_model.dataframe
172+
# convert_objects() picks fixed datatypes for columns that are
173+
# compatible with fixed datatypes, dramatically speeding up
174+
# pickling. But we don't impose fixed datatypes earlier than now
175+
# because the user is free to use mixed datatypes in a column, and
176+
# we won't want to prevent values of a different type being added
177+
# in the future. All kwargs False because we don't want to coerce
178+
# strings to numbers or anything - just choose the correct
179+
# datatype for columns that are already a single datatype:
180+
return app.filebox.shots_model.dataframe.convert_objects(
181+
convert_dates=False, convert_numeric=False, convert_timedeltas=False)
173182
elif isinstance(request_data, dict):
174183
if 'filepath' in request_data:
175184
h5_filepath = shared_drive.path_to_local(request_data['filepath'])
@@ -717,8 +726,8 @@ def reorder(self, order):
717726
name_item.setData(new_index, self.ROLE_SORTINDEX)
718727
self.ui.treeView.sortByColumn(self.COL_NAME, QtCore.Qt.AscendingOrder)
719728
# Apply new order to our list of routines too:
720-
self.routines = [self.routines[i] for i in order]
721-
729+
self.routines = [self.routines[order.index(i)] for i in range(len(order))]
730+
722731
def update_select_all_checkstate(self):
723732
with self.select_all_checkbox_state_changed_disconnected:
724733
all_states = []

0 commit comments

Comments
 (0)