atlas.core.command_line package

Submodules

atlas.core.command_line.cli_active_learning module

Run active learning loop from a TOML configuration file.

atlas.core.command_line.cli_active_learning.active_learning_run_print_details(process_pk: str, log_path: str, process_uuid: str = None, ntifysh_topic: str = None)

Prints pretty output for active learning using the rich library.

atlas.core.command_line.cli_active_learning.create_active_learning_builder(toml_dict: dict, toml_dict_path: Path = None, complete: bool = False, log_file_path: Path = None, al_start_mode: str = 'normal')

Create builder object for the ActiveLearningWorkChain.

Parameters:

toml_dict (dict) – Dictionary coming from parsing an ATL TOML settings file.

Returns:

A process builder that helps setting up the inputs for an ActiveLearningWorkChain.

Return type:

ProcessBuilder

atlas.core.command_line.cli_active_learning.read_toml_config(config_file: Path | str)
atlas.core.command_line.cli_active_learning.resume_al_loop_builder(prev_run_dir: Path, toml_dict_path: Path = None, log_file_path: Path = None, warnings: list[dict] = None)
atlas.core.command_line.cli_active_learning.run_active_learning()

atlas.core.command_line.cli_dashboard module

Launch a dashboard to monitor the active learning loop.

atlas.core.command_line.cli_dashboard.console_output(url: str, port: str, dash_pid: str, process_pk: str, log_path: str)

Prints a console output with the dashboard information using the rich library.

atlas.core.command_line.cli_dashboard.monitor_al_loop()
atlas.core.command_line.cli_dashboard.run_dashboard_app(process_id, port, update_interval, debug, online)

atlas.core.command_line.cli_db_analysis module

atlas.core.command_line.cli_generate_configuration_file module

Generate default configuration files for ATL from a YAML schema.

exception atlas.core.command_line.cli_generate_configuration_file.ValidationError

Bases: Exception

Custom exception for configuration validation errors.

atlas.core.command_line.cli_generate_configuration_file.format_value(value)

Formats a Python value into a TOML-compatible string.

atlas.core.command_line.cli_generate_configuration_file.gen_default_config()
atlas.core.command_line.cli_generate_configuration_file.generate_command(args, schema)

Handle the generate subcommand.

atlas.core.command_line.cli_generate_configuration_file.generate_template(schema, config_type)

Generates a complete TOML template file as a string.

Parameters:
  • schema (dict) – The entire configuration schema.

  • config_type (str) – The top-level key from the schema for which to generate the template.

Returns:

str

Return type:

The generated TOML template as a string.

atlas.core.command_line.cli_generate_configuration_file.generate_toml_recursive(schema_dict, path_parts, lines, prefix='', section_mandatory=True)

Recursively traverses the schema dictionary to generate TOML content.

Parameters:
  • schema_dict (dict) – The current section of the schema to process.

  • path_parts (list) – The list of keys representing the current path in the TOML structure.

  • lines (list) – The list of lines to which the generated TOML content will be appended.

  • prefix (str) – A prefix for keys when flattening a section.

  • section_mandatory (bool) – Whether the current section is mandatory.

atlas.core.command_line.cli_generate_configuration_file.validate_command(args, schema)

Handle the validate subcommand.

atlas.core.command_line.cli_generate_configuration_file.wrap_text_with_rich(text: str, width: int = 80, comment: bool = False) str

Wraps text using Rich’s formatting engine and optionally prepends comment characters.

Parameters:
  • text (str) – The long text string to be wrapped.

  • width (int, optional) – The target width for the wrapped text. Default is 50.

  • comment (bool, optional) – If True, prepends ‘# ‘ to each line of the wrapped output. Default is False.

Returns:

The wrapped text.

Return type:

str

atlas.core.command_line.cli_generate_docs module

Generate documentation for ATL configuration files from the YAML schema.

atlas.core.command_line.cli_generate_docs.format_parameter_line(key, details, level=0)

Format a parameter line according to the documentation style.

Parameters:
  • key (str) – Parameter name

  • details (dict) – Parameter details from schema

  • level (int) – Nesting level for indentation

Returns:

str

Return type:

Formatted parameter line

atlas.core.command_line.cli_generate_docs.generate_docs()

Main function to generate documentation.

atlas.core.command_line.cli_generate_docs.generate_full_documentation(schema, args)

Generate the complete documentation file.

Parameters:

schema (dict) – Complete schema from YAML file

Returns:

str

Return type:

Complete documentation as string

atlas.core.command_line.cli_generate_docs.generate_section_docs(schema_dict, path_parts, lines, level=3, original_schema=None)

Recursively generate documentation for a schema section.

Parameters:
  • schema_dict (dict) – Current section of the schema

  • path_parts (list) – Current path in the schema (for section headers)

  • lines (list) – List to append generated lines to

  • level (int) – Header level for markdown (3 = ###)

atlas.core.command_line.cli_generate_docs.generate_tool_section(schema, tool_name, tool_config)

Generate documentation for a specific tool.

Parameters:
  • schema (dict) – Full schema

  • tool_name (str) – Name of the tool (database_generation, dft, active_learning)

  • tool_config (dict) – Tool configuration from schema

Returns:

list

Return type:

Lines of generated documentation

atlas.core.command_line.cli_generate_init_db module

Generate an initial database from TOML config.

atlas.core.command_line.cli_generate_init_db.gen_initial_database(config_dict: dict)

Generate a initial database from TOML config.

A ATL database can be generated from settings specified in a TOML file.

Parameters:

toml_path (str) – Path for the TOML configuration file

atlas.core.command_line.cli_generate_init_db.run_gen_initial_database()

atlas.core.command_line.cli_latent_space_analysis module

atlas.core.command_line.cli_run_initial_config module

Run initial configuration to set up the ATLAS environment.

atlas.core.command_line.cli_run_initial_config.run_initial_config()

atlas.core.command_line.cli_train_autoencoder module

Train an autoencoder for dimensionality reduction.

atlas.core.command_line.cli_train_autoencoder.run_train_autoencoder()

atlas.core.command_line.command_line_utils module

Run an active-learning procedure based on ML-MD using aiida.

atlas.core.command_line.command_line_utils.apply_defaults(config_data, warning_msg_list)

Apply default values to missing parameters in the configuration.

Parameters:
  • config_data (dict) – The configuration data to check

  • warning_msg (str) – Warning message to display when applying defaults

Returns:

dict

Return type:

Configuration data with defaults applied

atlas.core.command_line.command_line_utils.check_deprecated_keys(config_data, schema_dict, path='', warnings=None)

Check for deprecated keys in configuration and provide migration suggestions.

Parameters:
  • config_data (dict) – The configuration data to check

  • schema_dict (dict) – The schema definition

  • path (str) – Current path in the configuration

  • warnings (list) – List to accumulate deprecation warnings

Returns:

  • dict (Migrated configuration data with deprecated keys mapped to new ones)

  • list (List of deprecation warnings)

atlas.core.command_line.command_line_utils.check_deprecated_parameters(config_data, schema_dict, path='')

Check for deprecated parameter names within a section.

Parameters:
  • config_data (dict) – The configuration data to check

  • schema_dict (dict) – The schema definition for this section

  • path (str) – Current path in the configuration

Returns:

  • dict (Migrated configuration data)

  • list (List of deprecation warnings)

atlas.core.command_line.command_line_utils.evaluate_dependency(depends_on, root_config_data)

Evaluate whether a dependency condition is met.

Parameters:
  • depends_on (dict) – The dependency specification from schema

  • root_config_data (dict) – Complete configuration data for resolving paths

Returns:

bool

Return type:

True if dependency condition is met, False otherwise

atlas.core.command_line.command_line_utils.get_schema()
atlas.core.command_line.command_line_utils.key_path_in_schema(full_path, schema_dict)

Ensure that a given key is not present in the schema dictionary.

Parameters:
  • full_path (str) – The path to check for absence in the schema.

  • schema_dict (dict) – The schema dictionary to check against.

Returns:

bool

Return type:

False if the key is not present in the schema, True otherwise.

atlas.core.command_line.command_line_utils.parse_input_toml(toml_dict: dict, type: str)

Parses and validates the input TOML dictionary based on the specified type.

Parameters:
  • toml_dict (dict) – The input dictionary parsed from a TOML file.

  • type (str) – The type of configuration to validate. Currently supports “active_learning”.

Raises:

MissingMandatoryParameterError – If any mandatory keys are missing from the input TOML dictionary.

atlas.core.command_line.command_line_utils.should_validate_mandatory(schema_item, root_config_data)

Determine if a schema item should be validated as mandatory based on dependencies.

Parameters:
  • schema_item (dict) – Schema definition for parameter or section

  • root_config_data (dict) – Complete configuration data

Returns:

bool

Return type:

True if item should be validated as mandatory

atlas.core.command_line.command_line_utils.validate_config_file(config_type, config_dict=None, config_path=None, allow_deprecated=False, run_mode='workflow', logger=None)

Validate a TOML configuration file against the schema.

Parameters:
  • config_path (str) – Path to the TOML configuration file

  • config_dict (dict) – The loaded configuration dictionary

  • config_type (str) – Type of configuration. One of: database_generation, dft, active_learning)

  • schema (dict) – The complete configuration schema

  • allow_deprecated (bool) – If True, deprecated keys will only generate warnings

  • run_mode (str) – Either ‘workflow’ or ‘script’. Workflow is for function runs at the start of a mdb workflow, before proceeding. ‘script’ is for standalone verification script execution.

Returns:

tuple – where any_errors_found is bool, errors is list of strings and warnings is list of dicts

Return type:

(any_errors_found, errors, warnings)

atlas.core.command_line.command_line_utils.validate_parameter(value, param_key, param_schema, path, root_config_data=None)

Validate a single parameter against its schema definition.

Parameters:
  • value – The value to validate

  • param_key (str) – The parameter key name

  • param_schema (dict) – The parameter schema definition

  • path (str) – The current path in the configuration for error reporting

  • root_config_data (dict) – Complete configuration data for dependency resolution

Returns:

list

Return type:

List of validation error messages (empty if valid)

atlas.core.command_line.command_line_utils.validate_section_recursive(config_data, schema_dict, path='', errors=None, warnings=None, section_mandatory=True, root_config_data=None, original_schema_dict=None)

Recursively validate a configuration section against its schema.

Parameters:
  • config_data (dict) – The configuration data to validate

  • schema_dict (dict) – The schema definition for this section

  • path (str) – Current path in the configuration

  • errors (list) – List to accumulate validation errors

  • section_mandatory (bool) – Whether the current section is mandatory

  • root_config_data (dict) – Complete configuration data for dependency resolution

Returns:

list

Return type:

List of validation error messages

Module contents

Module that contains the command line interface for atlas.