class_docstr: The workspace contains the processing information and state for
  a pipeline run on an image set
class_docstr_tok: ["The","workspace","contains","the","processing","information","and","state","for","a","pipeline","run","on","an","image","set"]
docstr: Refresh the image set if not present
  
  force - force a rewrite, even if the image set is cached
  
  This method executes Pipeline.prepare_run in order on self in order
  to write the image set image measurements to our internal
  measurements. If image set measurements are present, then we
  assume that the cache reflects pipeline + file list unless "force"
  is true.
code: def refresh_image_set(self, force=False):
      """Refresh the image set if not present
  
      force - force a rewrite, even if the image set is cached
  
      This method executes Pipeline.prepare_run in order on self in order
      to write the image set image measurements to our internal
      measurements. If image set measurements are present, then we
      assume that the cache reflects pipeline + file list unless "force"
      is true.
      """
      if len(self.measurements.get_image_numbers()) == 0 or force:
          self.measurements.clear()
          self.save_pipeline_to_measurements()
          modules = self.pipeline.modules()
          stop_module = None
          if len(modules) > 1 and not modules[-1].is_load_module():
              for module, next_module in zip(
                  self.pipeline.modules()[:-1],
                  self.pipeline.modules()[1:],
              ):
                  if module.is_load_module():
                      stop_module = next_module
  
          # TODO: Get rid of image_set_list
          no_image_set_list = self.image_set_list is None
          if no_image_set_list:
              from cellprofiler_core.image import ImageSetList
  
              self.__image_set_list = ImageSetList()
          try:
              result = self.pipeline.prepare_run(self, stop_module)
              return result
          except:
              LOGGER.error("Failed during prepare_run", exc_info=1)
              return False
          finally:
              if no_image_set_list:
                  self.__image_set_list = None
      return True
  
imports: import io
  import logging
  import os
  import h5py
  import cellprofiler_core.utilities.measurement
  from ._disposition_changed_event import DispositionChangedEvent
  from ..constants.measurement import EXPERIMENT
  from ..constants.workspace import DISPOSITION_CONTINUE
  from ..utilities.hdf5_dict import HDF5FileList
label_desc: Use image node_id 42 for calling the Workspace obj's underlying member method code with example usage: obj.refresh_image_set(force) and returns: True, result, False