def callback(cutout): grid.add_cutout(cutout, frame_index, time_index) if grid.is_filled(): self._cutout_grids[grid.source] = grid events.send(events.IMG_LOADED, grid.source) logger.info("Triplet grid finished downloading.")
def next_workunit(self): if self.work_units.is_on_last_item(): try: self._get_new_workunit() except NoAvailableWorkException: events.send(events.NO_AVAILABLE_WORK) return self.work_units.next()
def build_workunit(self, input_fullpath): try: parsed_data = self.parser.parse(input_fullpath) except AssertionError as e: logger.critical(str(e)) events.send(events.NO_AVAILABLE_WORK) logger.debug("Parsed %s (%d sources)" % (input_fullpath, parsed_data.get_source_count())) _, input_filename = os.path.split(input_fullpath) return self._do_build_workunit(input_filename, parsed_data, self.progress_manager, self.output_context, self.dry_run)
def next_workunit(self): if self.work_units.is_on_last_item(): try: self._get_new_workunit() except NoAvailableWorkException: events.send(events.NO_AVAILABLE_WORK) return # pre-load some work units if we are within 4 units of the end if self.work_units.index > len(self.work_units) - 3: try: self.workunit_provider.trigger_prefetching() except: pass self.work_units.next()
def build_workunit(self, input_fullpath): try: parsed_data = self.parser.parse(input_fullpath) except AssertionError as e: logger.critical(str(e)) events.send(events.NO_AVAILABLE_WORK) logger.debug("Parsed %s (%d sources)" % (input_fullpath, parsed_data.get_source_count())) _, input_filename = os.path.split(input_fullpath) return self._do_build_workunit( input_filename, parsed_data, self.progress_manager, self.output_context, self.dry_run)
def _on_finished_workunit(self, results_file_paths): events.send(events.FINISHED_WORKUNIT, results_file_paths) if self.synchronization_manager: for path in results_file_paths: self.synchronization_manager.add_syncable_file(path)
def next_item(self): if self.get_current_workunit().is_finished(): self.next_workunit() else: self.get_current_workunit().next_item() events.send(events.CHANGE_IMAGE)
def next_obs(self): self.get_current_workunit().next_obs() events.send(events.CHANGE_IMAGE)
def previous_obs(self): self.get_current_workunit().previous_obs() events.send(events.CHANGE_IMAGE)
def _on_finished_workunit(self, filename): events.send(events.FINISHED_WORKUNIT, filename)
def _on_image_loaded(self, reading, image): self._images_by_reading[reading] = image events.send(events.IMG_LOADED, reading)
def expect_image_transition(self): events.send(events.CHANGE_IMAGE)
def previous_item(self): self.get_current_workunit().previous_vettable_item() events.send(events.CHANGE_IMAGE)
def on_singlet_image_loaded(self, cutout): reading = cutout.reading self._cutouts[reading] = cutout events.send(events.IMG_LOADED, reading)
def pub_next_source(): events.send(events.CHANGE_IMAGE, data=1)