def create_data_object(self, dtype, name): """ Create a data object. Plugin developers should apply this method in loaders only. :params str dtype: either "in_data" or "out_data". """ bases = [] try: self.index[dtype][name] except KeyError: self.index[dtype][name] = Data(name, self) data_obj = self.index[dtype][name] bases.append(data_obj._get_transport_data()) cu.add_base_classes(data_obj, bases) return self.index[dtype][name]
def _deepcopy_data_object(dObj, new_obj): """ Deepcopy data object, associating hdf5 objects that can not be copied. """ cu.add_base_classes(new_obj, dObj._get_transport_data()) new_obj.meta_data = dObj.meta_data new_obj.pattern_list = copy.deepcopy(dObj.pattern_list) new_obj.data_info = copy.deepcopy(dObj.data_info) new_obj.exp = dObj.exp new_obj._plugin_data_obj = dObj._plugin_data_obj new_obj.dtype = copy.deepcopy(dObj.dtype) new_obj.remove = copy.deepcopy(dObj.remove) new_obj.group_name = dObj.group_name new_obj.group = dObj.group new_obj.backing_file = dObj.backing_file new_obj.data = dObj.data new_obj.next_shape = copy.deepcopy(dObj.next_shape) new_obj.orig_shape = copy.deepcopy(dObj.orig_shape) return new_obj