def update(self, params, values):
<EOL>comps = self.affected_components(params)<EOL>if len(comps) == <NUM_LIT:0>:<EOL><INDENT>return False<EOL><DEDENT>otile, itile, iotile = self.get_update_io_tiles(params, values)<EOL>if otile is None:<EOL><INDENT>return False<EOL><DEDENT>self.set_tile(otile)<EOL>oldmodel = self._model[itile.slicer].copy()<EOL>if len(comps) == <NUM_LIT:1> and self.mdl.get_difference_model(comps[<NUM_LIT:0>].category):<EOL><INDENT>comp = comps[<NUM_LIT:0>]<EOL>model0 = copy.deepcopy(comp.get())<EOL>super(ImageState, self).update(params, values)<EOL>model1 = copy.deepcopy(comp.get())<EOL>diff = model1 - model0<EOL>diff = self.mdl.evaluate(<EOL>self.comps, '<STR_LIT>', diffmap={comp.category: diff}<EOL>)<EOL>if isinstance(model0, (float, int)):<EOL><INDENT>self._model[itile.slicer] += diff<EOL><DEDENT>else:<EOL><INDENT>self._model[itile.slicer] += diff[iotile.slicer]<EOL><DEDENT><DEDENT>else:<EOL><INDENT>super(ImageState, self).update(params, values)<EOL>diff = self.mdl.evaluate(self.comps, '<STR_LIT>')<EOL>self._model[itile.slicer] = diff[iotile.slicer]<EOL><DEDENT>newmodel = self._model[itile.slicer].copy()<EOL>self.update_from_model_change(oldmodel, newmodel, itile)<EOL>return True<EOL>
Actually perform an image (etc) update based on a set of params and
values. These parameter can be any present in the components in any
number. If there is only one component affected then difference image
updates will be employed.