clearex.io.cli

Functions

create_parser()

Create the primary ClearEx command-line parser.

display_logo()

Print the ClearEx ASCII logo to stdout.

get_imaging_round(cli_value)

Resolve the imaging round integer from CLI or environment.

parse_slurm_args()

Parse SLURM-related command-line arguments.

clearex.io.cli.parse_slurm_args()

Parse SLURM-related command-line arguments.

This convenience helper builds an argparse.ArgumentParser configured to accept common SLURM-related options used by the registration workflow and returns the parsed namespace.

Parameters:

None

Returns:

Namespace with parsed values for imaging_round and save_directory.

Return type:

argparse.Namespace

Notes

The function does not inspect environment variables; it only parses command-line arguments. Use get_imaging_round() to resolve a final imaging round value that may come from the CLI or environment.

clearex.io.cli.get_imaging_round(cli_value)

Resolve the imaging round integer from CLI or environment.

The function returns the imaging round with the following priority: 1. The explicitly provided cli_value (if not None). 2. The IMAGING_ROUND environment variable (if set and an integer). 3. The SLURM_ARRAY_TASK_ID environment variable (if set and an integer). 4. A fallback default of 3.

Parameters:

cli_value (Optional[int]) – Value provided on the CLI; if not None this is returned directly.

Returns:

The resolved imaging round integer.

Return type:

int

Raises:

ValueError – If an environment variable is present but cannot be parsed as an integer.

clearex.io.cli.create_parser()

Create the primary ClearEx command-line parser.

Parameters:

None

Returns:

Parser configured with data input options, workflow selections, and GUI/headless execution controls.

Return type:

argparse.ArgumentParser

Print the ClearEx ASCII logo to stdout.

Parameters:

None

Returns:

The function prints output and does not return a value.

Return type:

None