ctdclient.model.processing module

class ctdclient.model.processing.ProcessingList(initlist=None)[source]

Bases: UserList

Collection of processing workflows.

data: list[ProcessingConfig][source]
read_processing_files()[source]

Fills collection with processing workflows.

run(file)[source]

Runs all active processing workflows.

Parameters:

file (Path | str) – The target file to process

cancel()[source]

Cancels all running processing workflows.

toggle_auto_process(new_value=None)[source]

Toggle the automatic processing of new files.

Parameters:

new_value (bool | None) – The value to set auto-processing to

toggle_config_activity_state(proc_config)[source]

Sets active state of specific processing workflow.

Parameters:

proc_config (ProcessingConfig) – The processing workflow to toggle

Return type:

Whether state has been altered.

create_new_processing_config(file)[source]

Assembles new processing workflow.

Parameters:

file (Path) – Path to processing workflow configuration file

Return type:

ProcessingConfig

get_template(template_path=PosixPath('/home/runner/work/CTD-Client/CTD-Client/src/ctdclient/resources/templates/processing_template.toml'))[source]

Creates a new processing workflow from template.

Parameters:

template_path (Path) – The file path to the template file

Return type:

ProcessingConfig instance of the template.

remove_config(config)[source]

Removes processing workflow from collection.

Parameters:

config (ProcessingConfig) – The processing workflow configuration

class ctdclient.model.processing.ProcessingConfig(path_to_config)[source]

Bases: ABC

Generic processing workflow.

current_config: Path[source]
abstractmethod run(file)[source]

Performs processing logic.

Parameters:

file (Path) – The target file to process

abstractmethod update_config(path_to_config)[source]

Updates processing workflow information.

Parameters:

path_to_config (Path | str) – File path to processing workflow configuration

abstractmethod wait()[source]

Waits for processing workflow to finish.

cancel()[source]

Cancels a running processing workflow.

class ctdclient.model.processing.ProcessingProcedure(path_to_config)[source]

Bases: ProcessingConfig

Processing workflow from ctdam python package workflows.

process: Process[source]
update_config(path_to_config)[source]

Updates processing workflow information.

Parameters:

path_to_config (Path | str) – File path to processing workflow configuration

run(file)[source]

Performs processing logic.

Parameters:

file (Path) – The target file to process

wait()[source]

Waits for processing workflow to finish.

apply_procedure(file)[source]

The processing logic to run in multiprocessing.

Parameters:

file (Path) – The target file to process

class ctdclient.model.processing.ProcessingScript(path_to_config)[source]

Bases: ProcessingConfig

Processing workflow from scripts.

process: Popen[source]
update_config(path_to_config)[source]

Updates processing workflow information.

Parameters:

path_to_config (Path | str) – File path to processing workflow configuration

run(file)[source]

Performs processing logic.

Parameters:

file (Path) – The target file to process

wait()[source]

Waits for processing workflow to finish.