@@ -169,7 +169,16 @@ def handler(self, request_data):
169
169
if request_data == 'hello' :
170
170
return 'hello'
171
171
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 )
173
182
elif isinstance (request_data , dict ):
174
183
if 'filepath' in request_data :
175
184
h5_filepath = shared_drive .path_to_local (request_data ['filepath' ])
@@ -717,8 +726,8 @@ def reorder(self, order):
717
726
name_item .setData (new_index , self .ROLE_SORTINDEX )
718
727
self .ui .treeView .sortByColumn (self .COL_NAME , QtCore .Qt .AscendingOrder )
719
728
# 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
+
722
731
def update_select_all_checkstate (self ):
723
732
with self .select_all_checkbox_state_changed_disconnected :
724
733
all_states = []
0 commit comments