dcnum.logic.ctrl
Attributes
Valid states for a DCNumJobRunner. |
Classes
Run a pipeline as defined by a |
Functions
|
Module Contents
- dcnum.logic.ctrl.mp_spawn = None
- dcnum.logic.ctrl.valid_states = ['created', 'init', 'setup', 'background', 'segmentation', 'plumbing', 'cleanup', 'done', 'error']
Valid states for a DCNumJobRunner. The states must be in logical order, not in alphabetical order.
- class dcnum.logic.ctrl.DCNumJobRunner(job: dcnum.logic.job.DCNumPipelineJob, tmp_suffix: str | None = None, *args, **kwargs)[source]
Bases:
threading.ThreadRun a pipeline as defined by a
job.DCNumPipelineJob- Parameters:
job (.job.DCNumPipelineJob) – pipeline job to run
tmp_suffix (str) – optional unique string for creating temporary files (defaults to hostname)
- error_tb = None
- job
- tmp_suffix = None
- event_count = 0
- _data_raw = None
- _data_temp_in = None
- _state = 'init'
- _progress_bg = None
- _progress_ex = None
- _progress_bn = None
- _segm_rate = 0
- main_logger
- path_log
- _log_file_handler
- log_queue
- _qlisten
- logger
- property draw: dcnum.read.HDF5Data
Raw input data
- property dtin: dcnum.read.HDF5Data
Input data with (corrected) background image
- property path_temp_in
- property path_temp_out
- property state
- join(delete_temporary_files=True, *args, **kwargs)[source]
Wait until the thread terminates.
This blocks the calling thread until the thread whose join() method is called terminates – either normally or through an unhandled exception or until the optional timeout occurs.
When the timeout argument is present and not None, it should be a floating point number specifying a timeout for the operation in seconds (or fractions thereof). As join() always returns None, you must call is_alive() after join() to decide whether a timeout happened – if the thread is still alive, the join() call timed out.
When the timeout argument is not present or None, the operation will block until the thread terminates.
A thread can be join()ed many times.
join() raises a RuntimeError if an attempt is made to join the current thread as that would cause a deadlock. It is also an error to join() a thread before it has been started and attempts to do so raises the same exception.
- run()[source]
Method representing the thread’s activity.
You may override this method in a subclass. The standard run() method invokes the callable object passed to the object’s constructor as the target argument, if any, with sequential and keyword arguments taken from the args and kwargs arguments, respectively.
- task_background()[source]
Perform background computation task
This populates the file self.path_temp_in with the ‘image_bg’ feature.
- task_enforce_basin_strategy()[source]
Transfer basin data from input files to output if requested
The user specified the “basin_strategy” keyword argument in self.job. If this is set to “drain”, then copy all basin information from the input file to the output file. If it is set to “tap”, then only create basins in the output file.