utopya models#

utopya models#

Show available models and register new ones.

utopya models [OPTIONS] COMMAND [ARGS]...

copy#

Copies a model implementation, creating a model with a new name and refactored file content.

For instance, all instances of MyModel will be replaced by CopiedModel in file paths and within the files themselves. There will NOT be any writing without a previous confirmation prompt. Alternatively, the --dry-run flag can be useful to get a preview of the effects this command would have.

Note that the model implementation will only be copied, registration still has to occur separately.

utopya models copy [OPTIONS] MODEL_NAME

Options

--label <label>#

For model names that have multiple info bundles registered, a label is needed to unambiguously select the desired one. Alternatively, use the utopya models set-default CLI command to set a default label for a model.

--new-name <new_name>#

Name of the new model. If not given, will prompt for it.

--target-project <target_project>#

Name of the utopya project to copy the new model to. If not given, will prompt for it. Note that this project needs to be known by utopya; use utopya projects register to register it first.

--pp, --postprocess, --no-pp, --no-postprocess#

Whether to run post-processing routines for the copied model.

Default:

True

--dry-run#

Perform a dry run: No copy or write operations will be carried out.

--skip-exts <skip_exts>#

File extensions to skip. To pass multiple values, use quotes and separate individual extensions using spaces. Leading dots are optional.

Default:

'.pyc'

-y, --yes#

If set, answers all prompts with yes.

-d, --debug#

The debug level.

Arguments

MODEL_NAME#

Required argument

edit#

Edit the model registry entry

utopya models edit [OPTIONS] MODEL_NAME

Arguments

MODEL_NAME#

Required argument

info#

Shows model information.

Currently, this only shows the available configuration set names.

utopya models info [OPTIONS] MODEL_NAME

Options

--label <label>#

For model names that have multiple info bundles registered, a label is needed to unambiguously select the desired one. Alternatively, use the utopya models set-default CLI command to set a default label for a model.

Arguments

MODEL_NAME#

Required argument

ls#

Lists all registered models

utopya models ls [OPTIONS]

Options

-l, --long#

Show more detailed information.

register#

Register new models, either individually or in a batch.

utopya models register [OPTIONS] COMMAND [ARGS]...

from-list#

Register multiple models by providing aligned lists of their names, the paths to their executables and their source directories. Any additional information is attempted to be extracted from the corresponding model source directory or a potentially existing model information file. Note that the arguments need to be separable lists, where the --separator argument determines the separation string. Also, arguments probably need to be put into quotes and spaces need to be escaped.

utopya models register from-list [OPTIONS] MODEL_NAMES

Options

--executables <executables>#

A list of paths pointing to the model executables. Paths may be given as relative to the --base-executable-dir. If all paths match a pattern, consider using the --executable-fstr argument instead. One of these arguments needs to be given.

--source-dirs <source_dirs>#

A list of paths pointing to the model source directories. Paths may be given as relative to the --base-source-dir. If all paths match a pattern, consider using the --source-dir-fstr argument instead.

--base-executable-dir <base_executable_dir>#

If given, relative executable paths are interpreted against this.

--base-source-dir <base_source_dir>#

If given, relative source directory paths are interpreted against this.

--executable-fstr <executable_fstr>#

A format string that can be used instead of the --executables argument and is evaluated for each entry in MODEL_NAMES.

--source-dir-fstr <source_dir_fstr>#

A format string that can be used instead of the --source-dirs argument and is evaluated for each entry in MODEL_NAMES.

--py-tests-dir-fstr <py_tests_dir_fstr>#

A format string that can be used to set the models python tests directory.

--py-plots-dir-fstr <py_plots_dir_fstr>#

A format string that can be used to set the models python tests directory.

--separator <separator>#

By which separator to split the --model-names, --executables, and --source-dirs arguments. Default: ;

--label <label>#

Label to identify the info bundles with; if not given, will use a default value. This allows registering multiple versions of a model under the same name.

--set-default#

Whether to set the registered model(s) as default.

--project-name <project_name>#

Name of the project these models are part of.

--exists-action <exists_action>#

Which action to take upon an existing bundle with the same label. By default, validates the to-be-added information with a potentially existing bundle; this will fail if the to-be-added bundle does not compare equal to an existing bundle with the same label.

Options:

skip | raise | validate | overwrite

Arguments

MODEL_NAMES#

Required argument

from-manifest#

Register one or many models using manifest files: YAML files that contains all relevant model information; see documentation for a valid manifest file format.

utopya models register from-manifest [OPTIONS] [MANIFEST_FILES]...

Options

--model-name <custom_model_name>#

If only a single manifest file is given, this option can be used to specify the model name, ignoring the one given in the manifest file.

--label <custom_label>#

If given, this label will be used instead of the one given in the manifest file(s). If no custom label is given and the manifest file does not define one either, the default will be from_manifest_file.

--set-default#

Whether to set the registered model(s) as default.

--project-name <custom_project_name>#

This option can be used to specify the project name, ignoring the name(s) specified in the manifest file(s).

--exists-action <exists_action>#

Which action to take upon an existing bundle with the same label. By default, validates the to-be-added information with a potentially existing bundle; this will fail if the to-be-added bundle does not compare equal to an existing bundle with the same label.

Options:

skip | raise | validate | overwrite

Arguments

MANIFEST_FILES#

Optional argument(s)

single#

Register a single new model or update an existing one.

utopya models register single [OPTIONS] MODEL_NAME

Options

-e, --executable <executable>#

Required Path to the model executable.

--source-dir <source_dir>#

Path to the directory that contains the model’s source files; this can be used to automatically extract model-related information like the default model configuration or plot-related configurations.

--default-cfg <default_cfg>#

Path to the model’s default configuration file.

--plots-cfg <plots_cfg>#

Path to the model’s default plots configuration file.

--label <label>#

Label to identify the info bundle with; if not given, will use a default value. This allows registering multiple versions of a model under the same name.

--set-default#

Whether to set the registered model(s) as default.

--project-name <project_name>#

Name of the project this model is part of.

--exists-action <exists_action>#

Which action to take upon an existing bundle with the same label. By default, validates the to-be-added information against a potentially existing bundle.

Options:

skip | raise | validate | overwrite

Arguments

MODEL_NAME#

Required argument

rm#

Removes info bundles from individual models

utopya models rm [OPTIONS] MODEL_NAME

Options

--label <label>#

For model names that have multiple info bundles registered, a label is needed to unambiguously select the desired one. Alternatively, use the utopya models set-default CLI command to set a default label for a model.

-a, --all#

If set, removes all info bundles and deletes the registry entry

-y, --yes#

If set, skips the confirmation prompt for removing all info bundles

Arguments

MODEL_NAME#

Required argument

set-default#

Sets the default info bundle to use for a model

utopya models set-default [OPTIONS] MODEL_NAME LABEL

Arguments

MODEL_NAME#

Required argument

LABEL#

Required argument