dcnum.logic.ctrl ================ .. py:module:: dcnum.logic.ctrl Attributes ---------- .. autoapisummary:: dcnum.logic.ctrl.mp_spawn dcnum.logic.ctrl.valid_states Classes ------- .. autoapisummary:: dcnum.logic.ctrl.DCNumJobRunner Functions --------- .. autoapisummary:: dcnum.logic.ctrl.get_library_versions_dict Module Contents --------------- .. py:data:: mp_spawn :value: None .. py:data:: valid_states :value: ['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. .. py:class:: DCNumJobRunner(job: dcnum.logic.job.DCNumPipelineJob, tmp_suffix: str | None = None, *args, **kwargs) Bases: :py:obj:`threading.Thread` Run a pipeline as defined by a :class:`.job.DCNumPipelineJob` :param job: pipeline job to run :type job: .job.DCNumPipelineJob :param tmp_suffix: optional unique string for creating temporary files (defaults to hostname) :type tmp_suffix: str .. py:attribute:: error_tb :value: None .. py:attribute:: job .. py:attribute:: tmp_suffix :value: None .. py:attribute:: event_count :value: 0 .. py:attribute:: _data_raw :value: None .. py:attribute:: _data_temp_in :value: None .. py:attribute:: _state :value: 'init' .. py:attribute:: _progress_bg :value: None .. py:attribute:: _progress_ex :value: None .. py:attribute:: _progress_bn :value: None .. py:attribute:: _segm_rate :value: 0 .. py:attribute:: main_logger .. py:attribute:: path_log .. py:attribute:: _log_file_handler .. py:attribute:: log_queue .. py:attribute:: _qlisten .. py:attribute:: logger .. py:method:: __enter__() .. py:method:: __exit__(exc_type, exc_val, exc_tb) .. py:property:: draw :type: dcnum.read.HDF5Data Raw input data .. py:property:: dtin :type: dcnum.read.HDF5Data Input data with (corrected) background image .. py:property:: path_temp_in .. py:property:: path_temp_out .. py:property:: state .. py:method:: close(delete_temporary_files=True) .. py:method:: join(delete_temporary_files=True, *args, **kwargs) 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. .. py:method:: get_status() .. py:method:: run() 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. .. py:method:: run_pipeline() Execute the pipeline job .. py:method:: task_background() Perform background computation task This populates the file `self.path_temp_in` with the 'image_bg' feature. .. py:method:: task_enforce_basin_strategy() 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. .. py:method:: task_segment_extract() .. py:function:: get_library_versions_dict(library_name_list)