def apply_function(self): '''Cf. `PiStage` docs.''' # TODO: do we need following line? Isn't this handled universally # by the base class (in PiStage's apply)? self.data.data_specs = self.output_specs # reset weights to initial weights prior to downstream stages running for container in self.data: vectorizer.set(container['initial_weights'], out=container['weights'])
def setup_function(self): """Setup the stage""" # set the correct data mode self.data.data_specs = self.calc_specs for container in self.data: container['calculated_pid'] = np.empty((container.size), dtype=FTYPE) container['original_pid'] = np.empty((container.size), dtype=FTYPE) vectorizer.set(container['pid'], out=container['original_pid'])
def apply_function(self): for container in self.data: vectorizer.set(container['initial_weights'], out=container['weights'])
def apply_function(self): for container in self.data: # set the pid value to the calculated one vectorizer.set(container['calculated_pid'], out=container['pid'])