dcnum.logic.ctrl

Attributes

mp_spawn

valid_states

Valid states for a DCNumJobRunner.

Classes

DCNumJobRunner

Run a pipeline as defined by a job.DCNumPipelineJob

Functions

get_library_versions_dict(library_name_list)

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.Thread

Run 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
__enter__()[source]
__exit__(exc_type, exc_val, exc_tb)[source]
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
close(delete_temporary_files=True)[source]
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.

get_status()[source]
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.

run_pipeline()[source]

Execute the pipeline job

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.

task_segment_extract()[source]
dcnum.logic.ctrl.get_library_versions_dict(library_name_list)[source]