cellmap_flow.cli.common

What the cellmap_flow subcommands share.

  • log_level_option: --log-level, which sets the level as soon as it is parsed.

  • ModelTypeGroup: a group with one subcommand per model type, built from the registry when asked for.

  • deprecated: a command under the name it had before 0.3.0, which says what replaces it and then runs it.

  • resample_option: --resample, of infer <type> and serve.

Attributes

LOG_LEVELS

REMOVED_IN

Classes

ModelTypeGroup

A group with a subcommand for each model type, besides its own.

Functions

log_level_option([default, help])

--log-level, applied when it is parsed rather than passed on.

resample_option()

--resample/--no-resample, on by default: read the dataset resampled

deprecation_notice(→ None)

Tell the user, on stderr, that old is going and new replaces it.

deprecated(→ click.Command)

command as old_name, its name before 0.3.0: hidden from --help,

Module Contents

cellmap_flow.cli.common.LOG_LEVELS = ['DEBUG', 'INFO', 'WARNING', 'ERROR', 'CRITICAL']
cellmap_flow.cli.common.REMOVED_IN = 'the release after 0.3.0'
cellmap_flow.cli.common.log_level_option(default=None, help='Set the logging level')

--log-level, applied when it is parsed rather than passed on.

The cellmap_flow group’s defaults to INFO. A subcommand that had its own before 0.3.0 (yaml, view, blockwise) keeps it, defaulting to None, so that cellmap_flow --log-level DEBUG yaml c.yaml is not reset to INFO by the subcommand’s default. Run on its own (python -m, as the dashboard’s blockwise tab runs blockwise), such a subcommand logs at INFO unless told otherwise.

cellmap_flow.cli.common.resample_option()

--resample/--no-resample, on by default: read the dataset resampled to the model’s input voxel size when it has no level at that size (ImageDataInterface’s on_voxel_size_mismatch="resample"). With --no-resample the level chosen is read as if it were at the model’s voxel size, with a warning.

class cellmap_flow.cli.common.ModelTypeGroup(*args, make_command, **kwargs)

A group with a subcommand for each model type, besides its own.

make_command(name, config_class) builds a type’s command when click asks for it, from the registry as it is at that moment: a type a plugin defines has its command, and nothing is built at import.

list_commands(ctx)

Returns a list of subcommand names in the order they should appear.

get_command(ctx, name)

Given a context and a command name, this returns a Command object if it exists or returns None.

cellmap_flow.cli.common.deprecation_notice(old: str, new: str) → None

Tell the user, on stderr, that old is going and new replaces it.

cellmap_flow.cli.common.deprecated(command: click.Command, old_name: str, old: str, new: str) → click.Command

command as old_name, its name before 0.3.0: hidden from –help, and saying that new replaces old each time before it runs.