ramble.workspace package

This package implements Ramble workspaces.

exception ramble.workspace.RambleActiveWorkspaceError(message: str, long_message: str | None = None)[source]

Bases: RambleWorkspaceError

Error when an invalid workspace is activated

exception ramble.workspace.RambleConflictingDefinitionError(message: str, long_message: str | None = None)[source]

Bases: RambleWorkspaceError

Error when conflicting software definitions are found

exception ramble.workspace.RambleInvalidTemplateNameError(message: str, long_message: str | None = None)[source]

Bases: RambleError

Error when an invalid template name is provided

exception ramble.workspace.RambleWorkspaceError(message: str, long_message: str | None = None)[source]

Bases: RambleError

Superclass for all errors to do with Ramble Workspaces

class ramble.workspace.Workspace(root, dry_run=False, read_default_template=True)[source]

Bases: object

Class representing a working directory for workload experiments

Each workspace must have a config directory, that contains 2 files by default.

  • ramble.yaml

  • execute_experiment.tpl

The ramble.yaml file is the overall configuration file for this workspace. It defines all experiments, variables, and the entire software stack.

The execute_experiment.tpl file is a template script that constants the blueprints for running each experiment. There are several ramble language features that can be used within the script, to help it render properly for all experiments.

Each file with the suffix of .tpl will be expanded into the experiment directory, with the .tpl suffix removed.

Directories will be created for each experiment, when the relevant phase of the application is executed. The workspace provides a self contained execution environment where experiments can be performed.

property active

True if this workspace is currently active.

add_experiments(application, workload_name_variable, workload_filters, include_default_variables, default_variable_value, variable_filters, variable_definitions, variant_definitions, experiment_name, package_manager=None, workflow_manager=None, zips=None, matrix=None, overwrite=False)[source]

Add new experiments to this workspace

Iterate over the workloads of the input application and define new experiments for each workload that matches any filter provided in workload_filters.

Parameters:
  • application (str) – Name of application to define experiments for

  • workload_name_variable (str) – Name of variable to contain workload names, if the workload names should be collapsed

  • workload_filters (list(str)) – List of filters to downselect workloads with

  • include_default_variables (bool) – Whether to include default variables in the resulting config or not

  • default_variable_value (str) – Default value to set undefined variables to

  • variable_filters (list(str)) – List of filters to downselect variables with

  • variable_definitions (list(str)) – List of variable definitions to use within generated experiments

  • variant_definitions (list(str)) – List of variant definitions to use within generated experiments

  • experiment_name (str) – The name of the experiments to add

  • package_manager (str) – Name of package manager to use for the generated experiments

  • workflow_manager (str) – Name of workflow manager to use for the generated experiments

  • zips (list(str) | None) – List of strings representing zips to define, in the format zipname=[var1,var2,var3]

  • matrix (str) – String representing a matrix to define within the experiment in the format of var1,var2,var3.

  • overwrite (bool) – Whether to overwrite existing definitions that collide with new definitions or not.

add_include(new_include)[source]

Add a new include to this workspace

add_modifier(name_pattern: str, scope: str | None = None, mode: str | None = None, on_executable: str | None = None, dry_run: bool = False)[source]

Add an arbitrary number of modifiers to this workspace within a single scope

Parameters:
  • scope – Scope to add modifiers within.

  • name_pattern – Pattern to determine which modifiers should be added. If multiple modifiers match, all will be added with the additional arguments.

  • mode – Mode to set within the new modifier definitions

  • on_executable – A list string to set for the on_executable attribute of the new modifier definitions.

  • dry_run – Whether to print the config instead of editing it, or to edit it directly.

Returns:

(int) Number of modifiers added to workspace

add_to_cache(tupl)[source]
all_applications()[source]

Iterator over applications

Returns application, context where context contains the platform level variables that should be applied.

all_auxiliary_software_files()[source]

Iterator over each file in $workspace/configs/auxiliary_software_files

all_experiments(workload)[source]

Iterator over experiments in a workload dict

Returns experiment, context Where context contains the workload level variables that should be applied.

property all_experiments_path
all_templates()[source]

Iterator over each template in the workspace

all_workloads(application)[source]

Iterator over workloads in an application dict

Returns workload, context where context contains the application level variables that should be applied.

append_result(result)[source]
property archive_dir

Path to the archive directory

property auxiliary_software_dir

Path to the auxiliary software files directory

build_experiment_set(die_on_validate_error=True)[source]

Create an experiment set representing this workspace

check_cache(tupl)[source]
clear()[source]
concretize(force=False, quiet=False)[source]

Concretize software definitions for defined experiments

Extract suggested software for experiments defined in a workspace, and ensure the software environments are defined properly.

Parameters:
  • force (bool) – Whether to overwrite conflicting definitions of named packages or not

  • quiet (bool) – Whether to silently ignore conflicts or not

property config_dir

Path to the configuration file directory

property config_file_path

Path to the configuration file directory

config_scopes()[source]

A list of all configuration scopes for this workspace.

create_mirror(mirror_root)[source]
date_string()[source]
default_results()[source]
property deployment_repos_dir

Path to the specific deployment directory that contains all the repos

property deployments_dir

Path to the deployments directory

destroy()[source]

Remove this workspace from Ramble entirely.

dump_results(output_formats=None, print_results=False, summary_only=False, fom_origin_types=None)[source]

Write out result file in desired format

This attempts to avoid the loss of previous results data by appending the datetime to the filename, but is willing to clobber the file results.latest.<extension>

dump_tables(experiment_set, filters)[source]
property experiment_dir

Path to the experiment directory

get_applications()[source]

Get the dictionary of applications

get_software_dict()[source]

Return the software dictionary for this workspace

get_workspace_env_vars()[source]

Return a dict of workspace environment variables

get_workspace_formatted_executables()[source]

Return a dict of workspace formatted executables

get_workspace_internals()[source]

Return a dict of workspace internals

get_workspace_modifiers()[source]

Return a dict of workspace modifiers

classmethod get_workspace_paths(root)[source]

Construct dictionary of path replacements for workspace

get_workspace_success_criteria()[source]

Return a dict of workspace success_criteria

get_workspace_tables()[source]

Return a dict of workspace tables

get_workspace_variants()[source]

Return a dict of workspace variants

get_workspace_vars()[source]

Return a dict of workspace variables

get_workspace_zips()[source]

Return a dict of workspace zips

hash_file_name = 'workspace_hash.sha256'
included_config_scopes()[source]

List of included configuration scopes from the environment.

Scopes are listed in the YAML file in order from highest to lowest precedence, so configuration from earlier scope will take precedence over later ones.

This routine returns them in the order they should be pushed onto the internal scope stack (so, in reverse, from lowest to highest).

index_modifiers()[source]

Construct a list of all modifiers in this workspace, and their associated scope.

Returns:

List of tuples, of the form (scope, modifier_definition)

Return type:

(list)

property input_dir

Path to the input directory

insert_result(result, insert_before_exp)[source]

Insert a result before a specified experiment

property internal

Whether this workspace is managed by Ramble.

property internal_subdir

Subdirectory for housing ramble internals

inventory_file_name = 'ramble_inventory.json'
property latest_archive
property latest_archive_path
property log_dir

Path to the logs directory

manage_environments(env_name, env_packages='', external_path=None, remove=False, overwrite=False)[source]

Manipulate software environments

Create, change, remove, and augment software environment definitions.

Parameters:
  • env_name (str) – Name of environment to manipulate

  • env_packages (str) – (Optional) Comma delimited list of packages to add into this environment

  • external_path (str) – (Optional) Path to external environment definition

  • remove (bool) – Whether the named environment should be removed from the workspace

  • overwrite (bool) – Whether new definition should overwrite existing definitions

manage_packages(pkg_name, pkg_spec='', compiler_pkg=None, compiler_spec=None, package_manager_prefix=None, remove=False, overwrite=False)[source]

Manage workspace package definitions

Create, remove, update, or augment package definitions.

Parameters:
  • pkg_name (str) – Name of package to manipulate

  • pkg_spec (str) – Package spec for the package manager

  • compiler_pkg (str) – Name of the package to use as a compiler for this package

  • compiler_spec (str) – When this package is used as a compiler for another, the string to refer to this package.

  • package_manager_prefix (str) – A package manager specific prefix to apply to package attribute definitions

  • remove (bool) – Whether the named package should be removed from the workspace

  • overwrite (bool) – Whether colliding definitions should be overwritten

property name

Human-readable representation of the workspace.

The name of the workspace is the basename of its path

property named_deployment

Path to the specific deployment directory

property path

Location of the workspace

print_config()[source]
print_modifiers()[source]

Print an indexed list of all modifiers in this workspace

read_config(section, f, raw_yaml=None)[source]

Read configuration file

read_file_content(file_path)[source]

Read and cache the file content

This should only be used on files that are not modified during the lifetime of the workspace command execution.

read_template(name, f)[source]

Read a template file

read_transaction()[source]

Get a read lock context manager for use in a with block.

remove_include(index=None, pattern=None)[source]

Remove one or more includes from this workspace.

Parameters:
  • index (int) – (Optional) Numerical position of include to remove

  • pattern (str) – (Optional) String or pattern of include to remove. Removes all matching includes.

remove_modifier(remove_index: int | None = None, scope_pattern: str | None = None, name_pattern: str | None = None, mode_pattern: str | None = None, dry_run: bool = False)[source]

Remove an arbitrary number of modifiers from this workspace based on some input arguments.

Parameters:
  • remove_index – Index of modifier to remove. Indices match ordering from the output of print_modifiers

  • scope_pattern – Pattern to select which scopes to remove modifiers from. If the pattern matches multiple scopes, each will have matching modifiers removed from them.

  • name_pattern – Pattern to select which modifier names should be removed. Modifiers with matching names that are in included scopes will be removed. If the scope doesn’t match, but the name does, the modifier will not be removed.

  • mode_pattern – Pattern to select which modes should be removed. Only Modifiers which match the scope and name patterns will be considered for removal, but this can be used to downselect further.

  • dry_run – Whether to print the config instead of editing it, or to edit it directly.

Returns:

(int) Number of modifiers removed

property results_dir

Directory where workspace results are stored

property shared_dir

Path to the shared directory

property shared_license_dir

Path to the shared license directory

simplify_software()[source]
simplify_variables()[source]

Simplify variable sections in workspace configuration file

property software_dir

Path to the software directory

squash_and_print_config(included_section=None, excluded_section=None)[source]

Create symlink of result file so that results.latest.txt always points to the most recent analysis. This clobbers the existing link

property tables_dir

Directory where workspace tables are stored

template_path(name)[source]
update_metadata(key, value)[source]

Set the metadata key value :param key: Key of metadata to set :type key: str :param value: Value to set in the metadata object :type value: Any

workspace_paths()[source]

Dictionary of path replacements for workspace

write(software_dir=None, inputs_dir=None)[source]

Write an in-memory workspace to its location on disk.

write_config(section, force=False)[source]

Update YAML config file for this workspace, based on changes and write it

write_metadata()[source]

Write out workspace metadata file

Create, and populate the metadata file in the root of the workspace. This file can be used to house cross-pipeline information.

write_software_info(f, exp)[source]
write_templates()[source]

Write all templates out to workspace

write_transaction()[source]

Get a write lock context manager for use in a with block.

ws_file_config_scope()[source]

Get the configuration scope for the workspace’s config file.

ws_file_config_scope_name()[source]

Name of the config scope of this workspace’s config file.

ramble.workspace.activate(ws)[source]

Activate a workspace.

To activate a workspace, we add its configuration scope to the existing Ramble configuration, and we set active to the current workspace.

Parameters:

ws (Workspace) – the workspace to activate

ramble.workspace.active(name)[source]

True if the named workspace is active.

ramble.workspace.active_workspace()[source]

Returns the active workspace when there is any

ramble.workspace.all_config_files(path)[source]

Returns path to all yaml files in workspace config directory

ramble.workspace.all_template_paths(path)[source]

Returns (abs) path to available template files in the workspace

ramble.workspace.all_workspace_names(parent_dir=None)[source]

List the names of workspaces that currently exist.

ramble.workspace.config_dict(yaml_data)[source]

Get the configuration scope section out of a ramble.yaml

ramble.workspace.config_file(path)[source]

Returns the path to a workspace’s ramble.yaml

ramble.workspace.create(name, read_default_template=True, parent_dir=None)[source]

Create a named workspace in Ramble

ramble.workspace.deactivate()[source]

Undo any configuration settings modified by activate().

ramble.workspace.exists(name, parent_dir=None)[source]

Whether a workspace with this name exists or not.

ramble.workspace.get_filepath(path, file_name)[source]
ramble.workspace.get_workspace_path()[source]

Returns current directory of ramble-managed workspaces

ramble.workspace.is_workspace_dir(path)[source]

Whether a directory contains a ramble workspace.

ramble.workspace.licenses_file(path)[source]

Returns the path to a workspace’s licenses.yaml

class ramble.workspace.namespace[source]

Bases: object

Class of namespace variables

application = 'applications'
chained_experiments = 'chained_experiments'
command = 'command'
commands = 'commands'
compiler = 'compiler'
compiler_spec = 'compiler_spec'
custom_executables = 'custom_executables'
env_var = 'env_vars'
environments = 'environments'
exclude = 'exclude'
executable_injection = 'executable_injection'
executables = 'executables'
experiment = 'experiments'
external_env = 'external_env'
formatted_executables = 'formatted_executables'
include = 'include'
indentation = 'indentation'
inherit_variables = 'inherit_variables'
internals = 'internals'
join_separator = 'join_separator'
matrices = 'matrices'
matrix = 'matrix'
metadata = 'metadata'
modifiers = 'modifiers'
n_repeats = 'n_repeats'
package_manager = 'package_manager'
packages = 'packages'
pkg_spec = 'pkg_spec'
platform = 'platform'
prefix = 'prefix'
ramble = 'ramble'
software = 'software'
success = 'success_criteria'
system = 'system'
tables = 'tables'
tags = 'tags'
template = 'template'
variables = 'variables'
variants = 'variants'
version = 'version'
where = 'where'
workflow_manager = 'workflow_manager'
workload = 'workloads'
workspace = 'workspace'
zips = 'zips'
ramble.workspace.no_active_workspace()[source]

Deactivate the active workspace for the duration of the context. Has no effect when there is no active workspace.

ramble.workspace.read(name)[source]

Get a workspace with the supplied name.

ramble.workspace.root(name, parent_dir=None)[source]

Get the root directory for a workspace by name.

ramble.workspace.template_path(ws_path, requested_template_name)[source]

Returns the path to a workspace’s template file

Submodules

ramble.workspace.shell module

ramble.workspace.shell.activate(ws)[source]

Activate an environment and append environment modifications

To activate an environment, we add its configuration scope to the existing Spack configuration, and we set active to the current environment.

Parameters:
  • env (spack.environment.Environment) – the environment to activate

  • use_env_repo (bool) – use the packages exactly as they appear in the environment’s repository

  • add_view (bool) – generate commands to add view to path variables

Returns:

Environment variables modifications to activate environment.

Return type:

spack.util.environment.EnvironmentModifications

ramble.workspace.shell.activate_header(ws, shell, prompt=None)[source]
ramble.workspace.shell.deactivate()[source]

Deactivate an environment and collect corresponding environment modifications.

Note: unloads the environment in its current state, not in the state it was

loaded in, meaning that specs that were removed from the spack environment after activation are not unloaded.

Returns:

Environment variables modifications to activate environment.

Return type:

spack.util.environment.EnvironmentModifications

ramble.workspace.shell.deactivate_header(shell)[source]

ramble.workspace.workspace module

ramble.workspace.workspace.AUXILIARY_SOFTWARE_DIR_NAME = 'auxiliary_software_files'

Directory name for auxiliary software files

ramble.workspace.workspace.LOCKFILE_NAME = 'ramble.lock'

Name of lockfile within a workspace

ramble.workspace.workspace.RAMBLE_WORKSPACE_VAR = 'RAMBLE_WORKSPACE'

Environment variable used to indicate the active workspace

exception ramble.workspace.workspace.RambleActiveWorkspaceError(message: str, long_message: str | None = None)[source]

Bases: RambleWorkspaceError

Error when an invalid workspace is activated

exception ramble.workspace.workspace.RambleConflictingDefinitionError(message: str, long_message: str | None = None)[source]

Bases: RambleWorkspaceError

Error when conflicting software definitions are found

exception ramble.workspace.workspace.RambleInvalidTemplateNameError(message: str, long_message: str | None = None)[source]

Bases: RambleError

Error when an invalid template name is provided

exception ramble.workspace.workspace.RambleWorkspaceError(message: str, long_message: str | None = None)[source]

Bases: RambleError

Superclass for all errors to do with Ramble Workspaces

ramble.workspace.workspace.VALID_WORKSPACE_NAME_RE = re.compile('^\\w[\\w-]*$')

regex for validating workspace names

ramble.workspace.workspace.WORKSPACE_ARCHIVE_PATH = 'archive'

Name of the subdirectory where workspace archives are stored

ramble.workspace.workspace.WORKSPACE_CONFIG_PATH = 'configs'

Subdirectory where workspace configs are stored

ramble.workspace.workspace.WORKSPACE_DEPLOYMENTS_PATH = 'deployments'

Name of the subdirectory where deployments are stored

ramble.workspace.workspace.WORKSPACE_EXPERIMENT_PATH = 'experiments'

Name of subdirectory within workspaces where experiments are stored

ramble.workspace.workspace.WORKSPACE_INPUT_PATH = 'inputs'

Name of subdirectory within workspaces where input files are stored

ramble.workspace.workspace.WORKSPACE_LOG_PATH = 'logs'

Name of subdirectory within workspaces where logs are stored

ramble.workspace.workspace.WORKSPACE_RESULTS_PATH = 'results'

Name of subdirectory within workspace where results are stored

ramble.workspace.workspace.WORKSPACE_SHARED_LICENSE_PATH = 'licenses'

Name of the subdirectory where shared license files are stored

ramble.workspace.workspace.WORKSPACE_SHARED_PATH = 'shared'

Name of the subdirectory where shared files are stored

ramble.workspace.workspace.WORKSPACE_SOFTWARE_PATH = 'software'

Name of subdirectory within workspaces where software environment are stored

ramble.workspace.workspace.WORKSPACE_TABLES_PATH = 'tables'

Name of subdirectory within workspace where tables are stored

class ramble.workspace.workspace.Workspace(root, dry_run=False, read_default_template=True)[source]

Bases: object

Class representing a working directory for workload experiments

Each workspace must have a config directory, that contains 2 files by default.

  • ramble.yaml

  • execute_experiment.tpl

The ramble.yaml file is the overall configuration file for this workspace. It defines all experiments, variables, and the entire software stack.

The execute_experiment.tpl file is a template script that constants the blueprints for running each experiment. There are several ramble language features that can be used within the script, to help it render properly for all experiments.

Each file with the suffix of .tpl will be expanded into the experiment directory, with the .tpl suffix removed.

Directories will be created for each experiment, when the relevant phase of the application is executed. The workspace provides a self contained execution environment where experiments can be performed.

property active

True if this workspace is currently active.

add_experiments(application, workload_name_variable, workload_filters, include_default_variables, default_variable_value, variable_filters, variable_definitions, variant_definitions, experiment_name, package_manager=None, workflow_manager=None, zips=None, matrix=None, overwrite=False)[source]

Add new experiments to this workspace

Iterate over the workloads of the input application and define new experiments for each workload that matches any filter provided in workload_filters.

Parameters:
  • application (str) – Name of application to define experiments for

  • workload_name_variable (str) – Name of variable to contain workload names, if the workload names should be collapsed

  • workload_filters (list(str)) – List of filters to downselect workloads with

  • include_default_variables (bool) – Whether to include default variables in the resulting config or not

  • default_variable_value (str) – Default value to set undefined variables to

  • variable_filters (list(str)) – List of filters to downselect variables with

  • variable_definitions (list(str)) – List of variable definitions to use within generated experiments

  • variant_definitions (list(str)) – List of variant definitions to use within generated experiments

  • experiment_name (str) – The name of the experiments to add

  • package_manager (str) – Name of package manager to use for the generated experiments

  • workflow_manager (str) – Name of workflow manager to use for the generated experiments

  • zips (list(str) | None) – List of strings representing zips to define, in the format zipname=[var1,var2,var3]

  • matrix (str) – String representing a matrix to define within the experiment in the format of var1,var2,var3.

  • overwrite (bool) – Whether to overwrite existing definitions that collide with new definitions or not.

add_include(new_include)[source]

Add a new include to this workspace

add_modifier(name_pattern: str, scope: str | None = None, mode: str | None = None, on_executable: str | None = None, dry_run: bool = False)[source]

Add an arbitrary number of modifiers to this workspace within a single scope

Parameters:
  • scope – Scope to add modifiers within.

  • name_pattern – Pattern to determine which modifiers should be added. If multiple modifiers match, all will be added with the additional arguments.

  • mode – Mode to set within the new modifier definitions

  • on_executable – A list string to set for the on_executable attribute of the new modifier definitions.

  • dry_run – Whether to print the config instead of editing it, or to edit it directly.

Returns:

(int) Number of modifiers added to workspace

add_to_cache(tupl)[source]
all_applications()[source]

Iterator over applications

Returns application, context where context contains the platform level variables that should be applied.

all_auxiliary_software_files()[source]

Iterator over each file in $workspace/configs/auxiliary_software_files

all_experiments(workload)[source]

Iterator over experiments in a workload dict

Returns experiment, context Where context contains the workload level variables that should be applied.

property all_experiments_path
all_templates()[source]

Iterator over each template in the workspace

all_workloads(application)[source]

Iterator over workloads in an application dict

Returns workload, context where context contains the application level variables that should be applied.

append_result(result)[source]
property archive_dir

Path to the archive directory

property auxiliary_software_dir

Path to the auxiliary software files directory

build_experiment_set(die_on_validate_error=True)[source]

Create an experiment set representing this workspace

check_cache(tupl)[source]
clear()[source]
concretize(force=False, quiet=False)[source]

Concretize software definitions for defined experiments

Extract suggested software for experiments defined in a workspace, and ensure the software environments are defined properly.

Parameters:
  • force (bool) – Whether to overwrite conflicting definitions of named packages or not

  • quiet (bool) – Whether to silently ignore conflicts or not

property config_dir

Path to the configuration file directory

property config_file_path

Path to the configuration file directory

config_scopes()[source]

A list of all configuration scopes for this workspace.

create_mirror(mirror_root)[source]
date_string()[source]
default_results()[source]
property deployment_repos_dir

Path to the specific deployment directory that contains all the repos

property deployments_dir

Path to the deployments directory

destroy()[source]

Remove this workspace from Ramble entirely.

dump_results(output_formats=None, print_results=False, summary_only=False, fom_origin_types=None)[source]

Write out result file in desired format

This attempts to avoid the loss of previous results data by appending the datetime to the filename, but is willing to clobber the file results.latest.<extension>

dump_tables(experiment_set, filters)[source]
property experiment_dir

Path to the experiment directory

get_applications()[source]

Get the dictionary of applications

get_software_dict()[source]

Return the software dictionary for this workspace

get_workspace_env_vars()[source]

Return a dict of workspace environment variables

get_workspace_formatted_executables()[source]

Return a dict of workspace formatted executables

get_workspace_internals()[source]

Return a dict of workspace internals

get_workspace_modifiers()[source]

Return a dict of workspace modifiers

classmethod get_workspace_paths(root)[source]

Construct dictionary of path replacements for workspace

get_workspace_success_criteria()[source]

Return a dict of workspace success_criteria

get_workspace_tables()[source]

Return a dict of workspace tables

get_workspace_variants()[source]

Return a dict of workspace variants

get_workspace_vars()[source]

Return a dict of workspace variables

get_workspace_zips()[source]

Return a dict of workspace zips

hash_file_name = 'workspace_hash.sha256'
included_config_scopes()[source]

List of included configuration scopes from the environment.

Scopes are listed in the YAML file in order from highest to lowest precedence, so configuration from earlier scope will take precedence over later ones.

This routine returns them in the order they should be pushed onto the internal scope stack (so, in reverse, from lowest to highest).

index_modifiers()[source]

Construct a list of all modifiers in this workspace, and their associated scope.

Returns:

List of tuples, of the form (scope, modifier_definition)

Return type:

(list)

property input_dir

Path to the input directory

insert_result(result, insert_before_exp)[source]

Insert a result before a specified experiment

property internal

Whether this workspace is managed by Ramble.

property internal_subdir

Subdirectory for housing ramble internals

inventory_file_name = 'ramble_inventory.json'
property latest_archive
property latest_archive_path
property log_dir

Path to the logs directory

manage_environments(env_name, env_packages='', external_path=None, remove=False, overwrite=False)[source]

Manipulate software environments

Create, change, remove, and augment software environment definitions.

Parameters:
  • env_name (str) – Name of environment to manipulate

  • env_packages (str) – (Optional) Comma delimited list of packages to add into this environment

  • external_path (str) – (Optional) Path to external environment definition

  • remove (bool) – Whether the named environment should be removed from the workspace

  • overwrite (bool) – Whether new definition should overwrite existing definitions

manage_packages(pkg_name, pkg_spec='', compiler_pkg=None, compiler_spec=None, package_manager_prefix=None, remove=False, overwrite=False)[source]

Manage workspace package definitions

Create, remove, update, or augment package definitions.

Parameters:
  • pkg_name (str) – Name of package to manipulate

  • pkg_spec (str) – Package spec for the package manager

  • compiler_pkg (str) – Name of the package to use as a compiler for this package

  • compiler_spec (str) – When this package is used as a compiler for another, the string to refer to this package.

  • package_manager_prefix (str) – A package manager specific prefix to apply to package attribute definitions

  • remove (bool) – Whether the named package should be removed from the workspace

  • overwrite (bool) – Whether colliding definitions should be overwritten

property name

Human-readable representation of the workspace.

The name of the workspace is the basename of its path

property named_deployment

Path to the specific deployment directory

property path

Location of the workspace

print_config()[source]
print_modifiers()[source]

Print an indexed list of all modifiers in this workspace

read_config(section, f, raw_yaml=None)[source]

Read configuration file

read_file_content(file_path)[source]

Read and cache the file content

This should only be used on files that are not modified during the lifetime of the workspace command execution.

read_template(name, f)[source]

Read a template file

read_transaction()[source]

Get a read lock context manager for use in a with block.

remove_include(index=None, pattern=None)[source]

Remove one or more includes from this workspace.

Parameters:
  • index (int) – (Optional) Numerical position of include to remove

  • pattern (str) – (Optional) String or pattern of include to remove. Removes all matching includes.

remove_modifier(remove_index: int | None = None, scope_pattern: str | None = None, name_pattern: str | None = None, mode_pattern: str | None = None, dry_run: bool = False)[source]

Remove an arbitrary number of modifiers from this workspace based on some input arguments.

Parameters:
  • remove_index – Index of modifier to remove. Indices match ordering from the output of print_modifiers

  • scope_pattern – Pattern to select which scopes to remove modifiers from. If the pattern matches multiple scopes, each will have matching modifiers removed from them.

  • name_pattern – Pattern to select which modifier names should be removed. Modifiers with matching names that are in included scopes will be removed. If the scope doesn’t match, but the name does, the modifier will not be removed.

  • mode_pattern – Pattern to select which modes should be removed. Only Modifiers which match the scope and name patterns will be considered for removal, but this can be used to downselect further.

  • dry_run – Whether to print the config instead of editing it, or to edit it directly.

Returns:

(int) Number of modifiers removed

property results_dir

Directory where workspace results are stored

property shared_dir

Path to the shared directory

property shared_license_dir

Path to the shared license directory

simplify_software()[source]
simplify_variables()[source]

Simplify variable sections in workspace configuration file

property software_dir

Path to the software directory

squash_and_print_config(included_section=None, excluded_section=None)[source]

Create symlink of result file so that results.latest.txt always points to the most recent analysis. This clobbers the existing link

property tables_dir

Directory where workspace tables are stored

template_path(name)[source]
update_metadata(key, value)[source]

Set the metadata key value :param key: Key of metadata to set :type key: str :param value: Value to set in the metadata object :type value: Any

workspace_paths()[source]

Dictionary of path replacements for workspace

write(software_dir=None, inputs_dir=None)[source]

Write an in-memory workspace to its location on disk.

write_config(section, force=False)[source]

Update YAML config file for this workspace, based on changes and write it

write_metadata()[source]

Write out workspace metadata file

Create, and populate the metadata file in the root of the workspace. This file can be used to house cross-pipeline information.

write_software_info(f, exp)[source]
write_templates()[source]

Write all templates out to workspace

write_transaction()[source]

Get a write lock context manager for use in a with block.

ws_file_config_scope()[source]

Get the configuration scope for the workspace’s config file.

ws_file_config_scope_name()[source]

Name of the config scope of this workspace’s config file.

ramble.workspace.workspace.activate(ws)[source]

Activate a workspace.

To activate a workspace, we add its configuration scope to the existing Ramble configuration, and we set active to the current workspace.

Parameters:

ws (Workspace) – the workspace to activate

ramble.workspace.workspace.active(name)[source]

True if the named workspace is active.

ramble.workspace.workspace.active_workspace()[source]

Returns the active workspace when there is any

ramble.workspace.workspace.all_config_files(path)[source]

Returns path to all yaml files in workspace config directory

ramble.workspace.workspace.all_template_paths(path)[source]

Returns (abs) path to available template files in the workspace

ramble.workspace.workspace.all_workspace_names(parent_dir=None)[source]

List the names of workspaces that currently exist.

ramble.workspace.workspace.applications_schema = {'$schema': 'http://json-schema.org/schema#', 'additionalProperties': False, 'properties': {'applications': {'additionalProperties': {'additionalProperties': False, 'default': '{}', 'properties': {'chained_experiments': {'default': [], 'items': {'additionalProperties': False, 'default': {}, 'properties': {'command': {'type': 'string'}, 'inherit_variables': {'default': [], 'items': {'type': 'string'}, 'type': 'array'}, 'name': {'type': 'string'}, 'order': {'type': 'string'}, 'variables': {'additionalProperties': True, 'default': {}, 'properties': {}, 'type': ['object', 'null']}}, 'type': 'object'}, 'type': 'array'}, 'env_vars': {'append': {'items': {'additionalProperties': {}, 'properties': {'paths': {'patternProperties': {'\\w[\\w-]*': {'anyOf': [{'type': 'string'}, {'type': 'number'}]}}, 'type': 'object'}, 'var-separator': {'type': 'string'}, 'vars': {'patternProperties': {'\\w[\\w-]*': {'anyOf': [{'type': 'string'}, {'type': 'number'}]}}, 'type': 'object'}}, 'type': 'object'}, 'type': 'array'}, 'prepend': {'items': {'additionalProperties': {}, 'properties': {'paths': {'patternProperties': {'\\w[\\w-]*': {'anyOf': [{'type': 'string'}, {'type': 'number'}]}}, 'type': 'object'}}, 'type': 'object'}, 'type': 'array'}, 'set': {'patternProperties': {'\\w[\\w-]*': {'anyOf': [{'type': 'string'}, {'type': 'number'}]}}, 'type': 'object'}, 'unset': {'default': [], 'items': {'anyOf': [{'type': 'string'}, {'type': 'number'}]}, 'type': 'array'}}, 'formatted_executables': {'additionalProperties': {'additionalProperties': False, 'default': {}, 'properties': {'commands': {'default': ['{unformatted_command}'], 'items': {'type': 'string'}, 'type': 'array'}, 'indentation': {'default': 0, 'type': 'number'}, 'join_separator': {'default': '\n', 'type': 'string'}, 'prefix': {'default': '', 'type': 'string'}}, 'type': 'object'}, 'default': {}, 'properties': {}, 'type': 'object'}, 'internals': {'additionalProperties': False, 'default': {}, 'properties': {'custom_executables': {'additionalProperties': {'default': {'force': False, 'output_capture': OUTPUT_CAPTURE.ALL, 'redirect': '{log_file}', 'template': [], 'use_mpi': False, 'variables': {}}, 'properties': {'force': {'type': 'boolean'}, 'redirect': {'anyOf': [{'type': 'string'}, {'type': 'number'}]}, 'template': {'anyOf': [{'type': 'string'}, {'type': 'number'}, {'default': [], 'items': {'anyOf': [{'type': 'string'}, {'type': 'number'}]}, 'type': 'array'}]}, 'use_mpi': {'type': 'boolean'}, 'variables': {'additionalProperties': True, 'default': {}, 'properties': {}, 'type': ['object', 'null']}}, 'type': 'object'}, 'default': {}, 'properties': {}, 'type': 'object'}, 'executable_injection': {'default': [], 'items': {'additionalProperties': {'relative_to': {'type': 'string'}}, 'default': {}, 'properties': {'name': {'type': 'string'}, 'order': {'default': 'after', 'type': 'string'}}, 'type': 'object'}, 'type': 'array'}, 'executables': {'default': [], 'items': {'anyOf': [{'type': 'string'}, {'type': 'number'}]}, 'type': 'array'}}, 'type': 'object'}, 'modifiers': {'default': [], 'items': {'additionalProperties': False, 'default': {}, 'properties': {'mode': {'type': 'string'}, 'name': {'type': 'string'}, 'on_executable': {'default': [], 'items': {'type': 'string'}, 'type': 'array'}}, 'type': 'object'}, 'type': 'array'}, 'success_criteria': {'default': [], 'items': {'additionalProperties': False, 'default': {}, 'properties': {'anti_match': {'default': None, 'type': 'string'}, 'file': {'default': None, 'type': 'string'}, 'fom_context': {'default': None, 'type': 'string'}, 'fom_name': {'default': None, 'type': 'string'}, 'formula': {'default': None, 'type': 'string'}, 'match': {'default': None, 'type': 'string'}, 'mode': {'type': 'string'}, 'name': {'type': 'string'}}, 'type': 'object'}, 'type': 'array'}, 'tables': {'default': [], 'items': {'additionalProperties': False, 'properties': {'autocolumns': {'items': {'additionalProperties': False, 'properties': {'context_name': {'type': 'string'}, 'figure_of_merit': {'type': 'string'}, 'figure_of_merit_origin_type': {'default': None, 'type': 'string'}, 'name': {'type': 'string'}, 'sort_by': {'default': None, 'items': {'type': 'string'}, 'type': ['string', 'array']}, 'where': {'items': {'type': 'string'}, 'type': 'array'}}, 'required': ['name', 'figure_of_merit'], 'type': 'object'}, 'type': 'array'}, 'columns': {'items': {'additionalProperties': False, 'properties': {'expression': {'default': None, 'type': 'string'}, 'figure_of_merit': {'default': None, 'type': 'string'}, 'figure_of_merit_context': {'default': None, 'type': 'string'}, 'figure_of_merit_origin_type': {'default': None, 'type': 'string'}, 'name': {'type': 'string'}, 'where': {'items': {'type': 'string'}, 'type': 'array'}}, 'required': ['name'], 'type': 'object'}, 'type': 'array'}, 'group_by': {'default': None, 'items': {'type': 'string'}, 'type': ['string', 'array']}, 'group_method': {'default': 'max', 'type': 'string'}, 'name': {'type': 'string'}, 'sort_by': {'default': None, 'items': {'type': 'string'}, 'type': ['string', 'array']}, 'transpose': {'default': False, 'type': 'boolean'}, 'where': {'items': {'type': 'string'}, 'type': 'array'}}, 'required': ['name'], 'type': 'object'}, 'type': 'array'}, 'tags': {'default': [], 'items': {'type': 'string'}, 'type': 'array'}, 'template': {'type': 'boolean'}, 'variables': {'additionalProperties': True, 'default': {}, 'properties': {}, 'type': ['object', 'null']}, 'variants': {'additionalProperties': True, 'default': {}, 'properties': {}, 'type': ['object', 'null']}, 'workloads': {'additionalProperties': {'additionalProperties': False, 'default': {}, 'properties': {'chained_experiments': {'default': [], 'items': {'additionalProperties': False, 'default': {}, 'properties': {'command': {'type': 'string'}, 'inherit_variables': {'default': [], 'items': {'type': 'string'}, 'type': 'array'}, 'name': {'type': 'string'}, 'order': {'type': 'string'}, 'variables': {'additionalProperties': True, 'default': {}, 'properties': {}, 'type': ['object', 'null']}}, 'type': 'object'}, 'type': 'array'}, 'env_vars': {'append': {'items': {'additionalProperties': {}, 'properties': {'paths': {'patternProperties': {'\\w[\\w-]*': {'anyOf': [{'type': 'string'}, {'type': 'number'}]}}, 'type': 'object'}, 'var-separator': {'type': 'string'}, 'vars': {'patternProperties': {'\\w[\\w-]*': {'anyOf': [{'type': 'string'}, {'type': 'number'}]}}, 'type': 'object'}}, 'type': 'object'}, 'type': 'array'}, 'prepend': {'items': {'additionalProperties': {}, 'properties': {'paths': {'patternProperties': {'\\w[\\w-]*': {'anyOf': [{'type': 'string'}, {'type': 'number'}]}}, 'type': 'object'}}, 'type': 'object'}, 'type': 'array'}, 'set': {'patternProperties': {'\\w[\\w-]*': {'anyOf': [{'type': 'string'}, {'type': 'number'}]}}, 'type': 'object'}, 'unset': {'default': [], 'items': {'anyOf': [{'type': 'string'}, {'type': 'number'}]}, 'type': 'array'}}, 'experiments': {'additionalProperties': {'additionalProperties': False, 'default': {}, 'properties': {'chained_experiments': {'default': [], 'items': {'additionalProperties': False, 'default': {}, 'properties': {'command': {'type': 'string'}, 'inherit_variables': {'default': [], 'items': {'type': 'string'}, 'type': 'array'}, 'name': {'type': 'string'}, 'order': {'type': 'string'}, 'variables': {'additionalProperties': True, 'default': {}, 'properties': {}, 'type': ['object', 'null']}}, 'type': 'object'}, 'type': 'array'}, 'env_vars': {'append': {'items': {'additionalProperties': {}, 'properties': {'paths': {'patternProperties': {'\\w[\\w-]*': {'anyOf': [{'type': 'string'}, {'type': 'number'}]}}, 'type': 'object'}, 'var-separator': {'type': 'string'}, 'vars': {'patternProperties': {'\\w[\\w-]*': {'anyOf': [{'type': 'string'}, {'type': 'number'}]}}, 'type': 'object'}}, 'type': 'object'}, 'type': 'array'}, 'prepend': {'items': {'additionalProperties': {}, 'properties': {'paths': {'patternProperties': {'\\w[\\w-]*': {'anyOf': [{'type': 'string'}, {'type': 'number'}]}}, 'type': 'object'}}, 'type': 'object'}, 'type': 'array'}, 'set': {'patternProperties': {'\\w[\\w-]*': {'anyOf': [{'type': 'string'}, {'type': 'number'}]}}, 'type': 'object'}, 'unset': {'default': [], 'items': {'anyOf': [{'type': 'string'}, {'type': 'number'}]}, 'type': 'array'}}, 'exclude': {'additionalProperties': False, 'default': {}, 'properties': {'matrices': {'default': [], 'items': {'anyOf': [{'default': [], 'items': {'type': 'string'}, 'type': 'array'}, {'additionalProperties': {'default': [], 'items': {'type': 'string'}, 'type': 'array'}, 'default': {}, 'properties': {}, 'type': 'object'}]}, 'type': 'array'}, 'matrix': {'default': [], 'items': {'type': 'string'}, 'type': 'array'}, 'variables': {'additionalProperties': True, 'default': {}, 'properties': {}, 'type': ['object', 'null']}, 'where': {'default': [], 'items': {'type': 'string'}, 'type': 'array'}, 'zips': {'additionalProperties': {'default': [], 'items': {'type': 'string'}, 'type': 'array'}, 'default': {}, 'properties': {}, 'type': 'object'}}, 'type': 'object'}, 'formatted_executables': {'additionalProperties': {'additionalProperties': False, 'default': {}, 'properties': {'commands': {'default': ['{unformatted_command}'], 'items': {'type': 'string'}, 'type': 'array'}, 'indentation': {'default': 0, 'type': 'number'}, 'join_separator': {'default': '\n', 'type': 'string'}, 'prefix': {'default': '', 'type': 'string'}}, 'type': 'object'}, 'default': {}, 'properties': {}, 'type': 'object'}, 'internals': {'additionalProperties': False, 'default': {}, 'properties': {'custom_executables': {'additionalProperties': {'default': {'force': False, 'output_capture': OUTPUT_CAPTURE.ALL, 'redirect': '{log_file}', 'template': [], 'use_mpi': False, 'variables': {}}, 'properties': {'force': {'type': 'boolean'}, 'redirect': {'anyOf': [{'type': 'string'}, {'type': 'number'}]}, 'template': {'anyOf': [{'type': 'string'}, {'type': 'number'}, {'default': [], 'items': {'anyOf': [{'type': 'string'}, {'type': 'number'}]}, 'type': 'array'}]}, 'use_mpi': {'type': 'boolean'}, 'variables': {'additionalProperties': True, 'default': {}, 'properties': {}, 'type': ['object', 'null']}}, 'type': 'object'}, 'default': {}, 'properties': {}, 'type': 'object'}, 'executable_injection': {'default': [], 'items': {'additionalProperties': {'relative_to': {'type': 'string'}}, 'default': {}, 'properties': {'name': {'type': 'string'}, 'order': {'default': 'after', 'type': 'string'}}, 'type': 'object'}, 'type': 'array'}, 'executables': {'default': [], 'items': {'anyOf': [{'type': 'string'}, {'type': 'number'}]}, 'type': 'array'}}, 'type': 'object'}, 'matrices': {'default': [], 'items': {'anyOf': [{'default': [], 'items': {'type': 'string'}, 'type': 'array'}, {'additionalProperties': {'default': [], 'items': {'type': 'string'}, 'type': 'array'}, 'default': {}, 'properties': {}, 'type': 'object'}]}, 'type': 'array'}, 'matrix': {'default': [], 'items': {'type': 'string'}, 'type': 'array'}, 'modifiers': {'default': [], 'items': {'additionalProperties': False, 'default': {}, 'properties': {'mode': {'type': 'string'}, 'name': {'type': 'string'}, 'on_executable': {'default': [], 'items': {'type': 'string'}, 'type': 'array'}}, 'type': 'object'}, 'type': 'array'}, 'n_repeats': {'anyOf': [{'type': 'string'}, {'type': 'number'}], 'default': 0}, 'success_criteria': {'default': [], 'items': {'additionalProperties': False, 'default': {}, 'properties': {'anti_match': {'default': None, 'type': 'string'}, 'file': {'default': None, 'type': 'string'}, 'fom_context': {'default': None, 'type': 'string'}, 'fom_name': {'default': None, 'type': 'string'}, 'formula': {'default': None, 'type': 'string'}, 'match': {'default': None, 'type': 'string'}, 'mode': {'type': 'string'}, 'name': {'type': 'string'}}, 'type': 'object'}, 'type': 'array'}, 'tables': {'default': [], 'items': {'additionalProperties': False, 'properties': {'autocolumns': {'items': {'additionalProperties': False, 'properties': {'context_name': {'type': 'string'}, 'figure_of_merit': {'type': 'string'}, 'figure_of_merit_origin_type': {'default': None, 'type': 'string'}, 'name': {'type': 'string'}, 'sort_by': {'default': None, 'items': {'type': 'string'}, 'type': ['string', 'array']}, 'where': {'items': {'type': 'string'}, 'type': 'array'}}, 'required': ['name', 'figure_of_merit'], 'type': 'object'}, 'type': 'array'}, 'columns': {'items': {'additionalProperties': False, 'properties': {'expression': {'default': None, 'type': 'string'}, 'figure_of_merit': {'default': None, 'type': 'string'}, 'figure_of_merit_context': {'default': None, 'type': 'string'}, 'figure_of_merit_origin_type': {'default': None, 'type': 'string'}, 'name': {'type': 'string'}, 'where': {'items': {'type': 'string'}, 'type': 'array'}}, 'required': ['name'], 'type': 'object'}, 'type': 'array'}, 'group_by': {'default': None, 'items': {'type': 'string'}, 'type': ['string', 'array']}, 'group_method': {'default': 'max', 'type': 'string'}, 'name': {'type': 'string'}, 'sort_by': {'default': None, 'items': {'type': 'string'}, 'type': ['string', 'array']}, 'transpose': {'default': False, 'type': 'boolean'}, 'where': {'items': {'type': 'string'}, 'type': 'array'}}, 'required': ['name'], 'type': 'object'}, 'type': 'array'}, 'tags': {'default': [], 'items': {'type': 'string'}, 'type': 'array'}, 'template': {'type': 'boolean'}, 'variables': {'additionalProperties': True, 'default': {}, 'properties': {}, 'type': ['object', 'null']}, 'variants': {'additionalProperties': True, 'default': {}, 'properties': {}, 'type': ['object', 'null']}, 'zips': {'additionalProperties': {'default': [], 'items': {'type': 'string'}, 'type': 'array'}, 'default': {}, 'properties': {}, 'type': 'object'}}, 'type': 'object'}, 'default': {}, 'properties': {}, 'type': 'object'}, 'formatted_executables': {'additionalProperties': {'additionalProperties': False, 'default': {}, 'properties': {'commands': {'default': ['{unformatted_command}'], 'items': {'type': 'string'}, 'type': 'array'}, 'indentation': {'default': 0, 'type': 'number'}, 'join_separator': {'default': '\n', 'type': 'string'}, 'prefix': {'default': '', 'type': 'string'}}, 'type': 'object'}, 'default': {}, 'properties': {}, 'type': 'object'}, 'internals': {'additionalProperties': False, 'default': {}, 'properties': {'custom_executables': {'additionalProperties': {'default': {'force': False, 'output_capture': OUTPUT_CAPTURE.ALL, 'redirect': '{log_file}', 'template': [], 'use_mpi': False, 'variables': {}}, 'properties': {'force': {'type': 'boolean'}, 'redirect': {'anyOf': [{'type': 'string'}, {'type': 'number'}]}, 'template': {'anyOf': [{'type': 'string'}, {'type': 'number'}, {'default': [], 'items': {'anyOf': [{'type': 'string'}, {'type': 'number'}]}, 'type': 'array'}]}, 'use_mpi': {'type': 'boolean'}, 'variables': {'additionalProperties': True, 'default': {}, 'properties': {}, 'type': ['object', 'null']}}, 'type': 'object'}, 'default': {}, 'properties': {}, 'type': 'object'}, 'executable_injection': {'default': [], 'items': {'additionalProperties': {'relative_to': {'type': 'string'}}, 'default': {}, 'properties': {'name': {'type': 'string'}, 'order': {'default': 'after', 'type': 'string'}}, 'type': 'object'}, 'type': 'array'}, 'executables': {'default': [], 'items': {'anyOf': [{'type': 'string'}, {'type': 'number'}]}, 'type': 'array'}}, 'type': 'object'}, 'modifiers': {'default': [], 'items': {'additionalProperties': False, 'default': {}, 'properties': {'mode': {'type': 'string'}, 'name': {'type': 'string'}, 'on_executable': {'default': [], 'items': {'type': 'string'}, 'type': 'array'}}, 'type': 'object'}, 'type': 'array'}, 'success_criteria': {'default': [], 'items': {'additionalProperties': False, 'default': {}, 'properties': {'anti_match': {'default': None, 'type': 'string'}, 'file': {'default': None, 'type': 'string'}, 'fom_context': {'default': None, 'type': 'string'}, 'fom_name': {'default': None, 'type': 'string'}, 'formula': {'default': None, 'type': 'string'}, 'match': {'default': None, 'type': 'string'}, 'mode': {'type': 'string'}, 'name': {'type': 'string'}}, 'type': 'object'}, 'type': 'array'}, 'tables': {'default': [], 'items': {'additionalProperties': False, 'properties': {'autocolumns': {'items': {'additionalProperties': False, 'properties': {'context_name': {'type': 'string'}, 'figure_of_merit': {'type': 'string'}, 'figure_of_merit_origin_type': {'default': None, 'type': 'string'}, 'name': {'type': 'string'}, 'sort_by': {'default': None, 'items': {'type': 'string'}, 'type': ['string', 'array']}, 'where': {'items': {'type': 'string'}, 'type': 'array'}}, 'required': ['name', 'figure_of_merit'], 'type': 'object'}, 'type': 'array'}, 'columns': {'items': {'additionalProperties': False, 'properties': {'expression': {'default': None, 'type': 'string'}, 'figure_of_merit': {'default': None, 'type': 'string'}, 'figure_of_merit_context': {'default': None, 'type': 'string'}, 'figure_of_merit_origin_type': {'default': None, 'type': 'string'}, 'name': {'type': 'string'}, 'where': {'items': {'type': 'string'}, 'type': 'array'}}, 'required': ['name'], 'type': 'object'}, 'type': 'array'}, 'group_by': {'default': None, 'items': {'type': 'string'}, 'type': ['string', 'array']}, 'group_method': {'default': 'max', 'type': 'string'}, 'name': {'type': 'string'}, 'sort_by': {'default': None, 'items': {'type': 'string'}, 'type': ['string', 'array']}, 'transpose': {'default': False, 'type': 'boolean'}, 'where': {'items': {'type': 'string'}, 'type': 'array'}}, 'required': ['name'], 'type': 'object'}, 'type': 'array'}, 'tags': {'default': [], 'items': {'type': 'string'}, 'type': 'array'}, 'template': {'type': 'boolean'}, 'variables': {'additionalProperties': True, 'default': {}, 'properties': {}, 'type': ['object', 'null']}, 'variants': {'additionalProperties': True, 'default': {}, 'properties': {}, 'type': ['object', 'null']}, 'zips': {'additionalProperties': {'default': [], 'items': {'type': 'string'}, 'type': 'array'}, 'default': {}, 'properties': {}, 'type': 'object'}}, 'type': 'object'}, 'default': {}, 'properties': {}, 'type': 'object'}, 'zips': {'additionalProperties': {'default': [], 'items': {'type': 'string'}, 'type': 'array'}, 'default': {}, 'properties': {}, 'type': 'object'}}, 'type': 'object'}, 'default': {}, 'properties': {}, 'type': 'object'}}, 'title': 'Ramble application configuration file schema', 'type': 'object'}

Config schema for application files

ramble.workspace.workspace.config_dict(yaml_data)[source]

Get the configuration scope section out of a ramble.yaml

ramble.workspace.workspace.config_file(path)[source]

Returns the path to a workspace’s ramble.yaml

ramble.workspace.workspace.config_schema = {'$schema': 'http://json-schema.org/schema#', 'properties': {'ramble': {'additionalProperties': False, 'default': {}, 'properties': {'applications': {'additionalProperties': {'additionalProperties': False, 'default': '{}', 'properties': {'chained_experiments': {'default': [], 'items': {'additionalProperties': False, 'default': {}, 'properties': {'command': {'type': 'string'}, 'inherit_variables': {'default': [], 'items': {'type': 'string'}, 'type': 'array'}, 'name': {'type': 'string'}, 'order': {'type': 'string'}, 'variables': {'additionalProperties': True, 'default': {}, 'properties': {}, 'type': ['object', 'null']}}, 'type': 'object'}, 'type': 'array'}, 'env_vars': {'append': {'items': {'additionalProperties': {}, 'properties': {'paths': {'patternProperties': {'\\w[\\w-]*': {'anyOf': [{'type': 'string'}, {'type': 'number'}]}}, 'type': 'object'}, 'var-separator': {'type': 'string'}, 'vars': {'patternProperties': {'\\w[\\w-]*': {'anyOf': [{'type': 'string'}, {'type': 'number'}]}}, 'type': 'object'}}, 'type': 'object'}, 'type': 'array'}, 'prepend': {'items': {'additionalProperties': {}, 'properties': {'paths': {'patternProperties': {'\\w[\\w-]*': {'anyOf': [{'type': 'string'}, {'type': 'number'}]}}, 'type': 'object'}}, 'type': 'object'}, 'type': 'array'}, 'set': {'patternProperties': {'\\w[\\w-]*': {'anyOf': [{'type': 'string'}, {'type': 'number'}]}}, 'type': 'object'}, 'unset': {'default': [], 'items': {'anyOf': [{'type': 'string'}, {'type': 'number'}]}, 'type': 'array'}}, 'formatted_executables': {'additionalProperties': {'additionalProperties': False, 'default': {}, 'properties': {'commands': {'default': ['{unformatted_command}'], 'items': {'type': 'string'}, 'type': 'array'}, 'indentation': {'default': 0, 'type': 'number'}, 'join_separator': {'default': '\n', 'type': 'string'}, 'prefix': {'default': '', 'type': 'string'}}, 'type': 'object'}, 'default': {}, 'properties': {}, 'type': 'object'}, 'internals': {'additionalProperties': False, 'default': {}, 'properties': {'custom_executables': {'additionalProperties': {'default': {'force': False, 'output_capture': OUTPUT_CAPTURE.ALL, 'redirect': '{log_file}', 'template': [], 'use_mpi': False, 'variables': {}}, 'properties': {'force': {'type': 'boolean'}, 'redirect': {'anyOf': [{'type': 'string'}, {'type': 'number'}]}, 'template': {'anyOf': [{'type': 'string'}, {'type': 'number'}, {'default': [], 'items': {'anyOf': [{'type': 'string'}, {'type': 'number'}]}, 'type': 'array'}]}, 'use_mpi': {'type': 'boolean'}, 'variables': {'additionalProperties': True, 'default': {}, 'properties': {}, 'type': ['object', 'null']}}, 'type': 'object'}, 'default': {}, 'properties': {}, 'type': 'object'}, 'executable_injection': {'default': [], 'items': {'additionalProperties': {'relative_to': {'type': 'string'}}, 'default': {}, 'properties': {'name': {'type': 'string'}, 'order': {'default': 'after', 'type': 'string'}}, 'type': 'object'}, 'type': 'array'}, 'executables': {'default': [], 'items': {'anyOf': [{'type': 'string'}, {'type': 'number'}]}, 'type': 'array'}}, 'type': 'object'}, 'modifiers': {'default': [], 'items': {'additionalProperties': False, 'default': {}, 'properties': {'mode': {'type': 'string'}, 'name': {'type': 'string'}, 'on_executable': {'default': [], 'items': {'type': 'string'}, 'type': 'array'}}, 'type': 'object'}, 'type': 'array'}, 'success_criteria': {'default': [], 'items': {'additionalProperties': False, 'default': {}, 'properties': {'anti_match': {'default': None, 'type': 'string'}, 'file': {'default': None, 'type': 'string'}, 'fom_context': {'default': None, 'type': 'string'}, 'fom_name': {'default': None, 'type': 'string'}, 'formula': {'default': None, 'type': 'string'}, 'match': {'default': None, 'type': 'string'}, 'mode': {'type': 'string'}, 'name': {'type': 'string'}}, 'type': 'object'}, 'type': 'array'}, 'tables': {'default': [], 'items': {'additionalProperties': False, 'properties': {'autocolumns': {'items': {'additionalProperties': False, 'properties': {'context_name': {'type': 'string'}, 'figure_of_merit': {'type': 'string'}, 'figure_of_merit_origin_type': {'default': None, 'type': 'string'}, 'name': {'type': 'string'}, 'sort_by': {'default': None, 'items': {'type': 'string'}, 'type': ['string', 'array']}, 'where': {'items': {'type': 'string'}, 'type': 'array'}}, 'required': ['name', 'figure_of_merit'], 'type': 'object'}, 'type': 'array'}, 'columns': {'items': {'additionalProperties': False, 'properties': {'expression': {'default': None, 'type': 'string'}, 'figure_of_merit': {'default': None, 'type': 'string'}, 'figure_of_merit_context': {'default': None, 'type': 'string'}, 'figure_of_merit_origin_type': {'default': None, 'type': 'string'}, 'name': {'type': 'string'}, 'where': {'items': {'type': 'string'}, 'type': 'array'}}, 'required': ['name'], 'type': 'object'}, 'type': 'array'}, 'group_by': {'default': None, 'items': {'type': 'string'}, 'type': ['string', 'array']}, 'group_method': {'default': 'max', 'type': 'string'}, 'name': {'type': 'string'}, 'sort_by': {'default': None, 'items': {'type': 'string'}, 'type': ['string', 'array']}, 'transpose': {'default': False, 'type': 'boolean'}, 'where': {'items': {'type': 'string'}, 'type': 'array'}}, 'required': ['name'], 'type': 'object'}, 'type': 'array'}, 'tags': {'default': [], 'items': {'type': 'string'}, 'type': 'array'}, 'template': {'type': 'boolean'}, 'variables': {'additionalProperties': True, 'default': {}, 'properties': {}, 'type': ['object', 'null']}, 'variants': {'additionalProperties': True, 'default': {}, 'properties': {}, 'type': ['object', 'null']}, 'workloads': {'additionalProperties': {'additionalProperties': False, 'default': {}, 'properties': {'chained_experiments': {'default': [], 'items': {'additionalProperties': False, 'default': {}, 'properties': {'command': {'type': 'string'}, 'inherit_variables': {'default': [], 'items': {'type': 'string'}, 'type': 'array'}, 'name': {'type': 'string'}, 'order': {'type': 'string'}, 'variables': {'additionalProperties': True, 'default': {}, 'properties': {}, 'type': ['object', 'null']}}, 'type': 'object'}, 'type': 'array'}, 'env_vars': {'append': {'items': {'additionalProperties': {}, 'properties': {'paths': {'patternProperties': {'\\w[\\w-]*': {'anyOf': [{'type': 'string'}, {'type': 'number'}]}}, 'type': 'object'}, 'var-separator': {'type': 'string'}, 'vars': {'patternProperties': {'\\w[\\w-]*': {'anyOf': [{'type': 'string'}, {'type': 'number'}]}}, 'type': 'object'}}, 'type': 'object'}, 'type': 'array'}, 'prepend': {'items': {'additionalProperties': {}, 'properties': {'paths': {'patternProperties': {'\\w[\\w-]*': {'anyOf': [{'type': 'string'}, {'type': 'number'}]}}, 'type': 'object'}}, 'type': 'object'}, 'type': 'array'}, 'set': {'patternProperties': {'\\w[\\w-]*': {'anyOf': [{'type': 'string'}, {'type': 'number'}]}}, 'type': 'object'}, 'unset': {'default': [], 'items': {'anyOf': [{'type': 'string'}, {'type': 'number'}]}, 'type': 'array'}}, 'experiments': {'additionalProperties': {'additionalProperties': False, 'default': {}, 'properties': {'chained_experiments': {'default': [], 'items': {'additionalProperties': False, 'default': {}, 'properties': {'command': {'type': 'string'}, 'inherit_variables': {'default': [], 'items': {'type': 'string'}, 'type': 'array'}, 'name': {'type': 'string'}, 'order': {'type': 'string'}, 'variables': {'additionalProperties': True, 'default': {}, 'properties': {}, 'type': ['object', 'null']}}, 'type': 'object'}, 'type': 'array'}, 'env_vars': {'append': {'items': {'additionalProperties': {}, 'properties': {'paths': {'patternProperties': {'\\w[\\w-]*': {'anyOf': [{'type': 'string'}, {'type': 'number'}]}}, 'type': 'object'}, 'var-separator': {'type': 'string'}, 'vars': {'patternProperties': {'\\w[\\w-]*': {'anyOf': [{'type': 'string'}, {'type': 'number'}]}}, 'type': 'object'}}, 'type': 'object'}, 'type': 'array'}, 'prepend': {'items': {'additionalProperties': {}, 'properties': {'paths': {'patternProperties': {'\\w[\\w-]*': {'anyOf': [{'type': 'string'}, {'type': 'number'}]}}, 'type': 'object'}}, 'type': 'object'}, 'type': 'array'}, 'set': {'patternProperties': {'\\w[\\w-]*': {'anyOf': [{'type': 'string'}, {'type': 'number'}]}}, 'type': 'object'}, 'unset': {'default': [], 'items': {'anyOf': [{'type': 'string'}, {'type': 'number'}]}, 'type': 'array'}}, 'exclude': {'additionalProperties': False, 'default': {}, 'properties': {'matrices': {'default': [], 'items': {'anyOf': [{'default': [], 'items': {'type': 'string'}, 'type': 'array'}, {'additionalProperties': {'default': [], 'items': {'type': 'string'}, 'type': 'array'}, 'default': {}, 'properties': {}, 'type': 'object'}]}, 'type': 'array'}, 'matrix': {'default': [], 'items': {'type': 'string'}, 'type': 'array'}, 'variables': {'additionalProperties': True, 'default': {}, 'properties': {}, 'type': ['object', 'null']}, 'where': {'default': [], 'items': {'type': 'string'}, 'type': 'array'}, 'zips': {'additionalProperties': {'default': [], 'items': {'type': 'string'}, 'type': 'array'}, 'default': {}, 'properties': {}, 'type': 'object'}}, 'type': 'object'}, 'formatted_executables': {'additionalProperties': {'additionalProperties': False, 'default': {}, 'properties': {'commands': {'default': ['{unformatted_command}'], 'items': {'type': 'string'}, 'type': 'array'}, 'indentation': {'default': 0, 'type': 'number'}, 'join_separator': {'default': '\n', 'type': 'string'}, 'prefix': {'default': '', 'type': 'string'}}, 'type': 'object'}, 'default': {}, 'properties': {}, 'type': 'object'}, 'internals': {'additionalProperties': False, 'default': {}, 'properties': {'custom_executables': {'additionalProperties': {'default': {'force': False, 'output_capture': OUTPUT_CAPTURE.ALL, 'redirect': '{log_file}', 'template': [], 'use_mpi': False, 'variables': {}}, 'properties': {'force': {'type': 'boolean'}, 'redirect': {'anyOf': [{'type': 'string'}, {'type': 'number'}]}, 'template': {'anyOf': [{'type': 'string'}, {'type': 'number'}, {'default': [], 'items': {'anyOf': [{'type': 'string'}, {'type': 'number'}]}, 'type': 'array'}]}, 'use_mpi': {'type': 'boolean'}, 'variables': {'additionalProperties': True, 'default': {}, 'properties': {}, 'type': ['object', 'null']}}, 'type': 'object'}, 'default': {}, 'properties': {}, 'type': 'object'}, 'executable_injection': {'default': [], 'items': {'additionalProperties': {'relative_to': {'type': 'string'}}, 'default': {}, 'properties': {'name': {'type': 'string'}, 'order': {'default': 'after', 'type': 'string'}}, 'type': 'object'}, 'type': 'array'}, 'executables': {'default': [], 'items': {'anyOf': [{'type': 'string'}, {'type': 'number'}]}, 'type': 'array'}}, 'type': 'object'}, 'matrices': {'default': [], 'items': {'anyOf': [{'default': [], 'items': {'type': 'string'}, 'type': 'array'}, {'additionalProperties': {'default': [], 'items': {'type': 'string'}, 'type': 'array'}, 'default': {}, 'properties': {}, 'type': 'object'}]}, 'type': 'array'}, 'matrix': {'default': [], 'items': {'type': 'string'}, 'type': 'array'}, 'modifiers': {'default': [], 'items': {'additionalProperties': False, 'default': {}, 'properties': {'mode': {'type': 'string'}, 'name': {'type': 'string'}, 'on_executable': {'default': [], 'items': {'type': 'string'}, 'type': 'array'}}, 'type': 'object'}, 'type': 'array'}, 'n_repeats': {'anyOf': [{'type': 'string'}, {'type': 'number'}], 'default': 0}, 'success_criteria': {'default': [], 'items': {'additionalProperties': False, 'default': {}, 'properties': {'anti_match': {'default': None, 'type': 'string'}, 'file': {'default': None, 'type': 'string'}, 'fom_context': {'default': None, 'type': 'string'}, 'fom_name': {'default': None, 'type': 'string'}, 'formula': {'default': None, 'type': 'string'}, 'match': {'default': None, 'type': 'string'}, 'mode': {'type': 'string'}, 'name': {'type': 'string'}}, 'type': 'object'}, 'type': 'array'}, 'tables': {'default': [], 'items': {'additionalProperties': False, 'properties': {'autocolumns': {'items': {'additionalProperties': False, 'properties': {'context_name': {'type': 'string'}, 'figure_of_merit': {'type': 'string'}, 'figure_of_merit_origin_type': {'default': None, 'type': 'string'}, 'name': {'type': 'string'}, 'sort_by': {'default': None, 'items': {'type': 'string'}, 'type': ['string', 'array']}, 'where': {'items': {'type': 'string'}, 'type': 'array'}}, 'required': ['name', 'figure_of_merit'], 'type': 'object'}, 'type': 'array'}, 'columns': {'items': {'additionalProperties': False, 'properties': {'expression': {'default': None, 'type': 'string'}, 'figure_of_merit': {'default': None, 'type': 'string'}, 'figure_of_merit_context': {'default': None, 'type': 'string'}, 'figure_of_merit_origin_type': {'default': None, 'type': 'string'}, 'name': {'type': 'string'}, 'where': {'items': {'type': 'string'}, 'type': 'array'}}, 'required': ['name'], 'type': 'object'}, 'type': 'array'}, 'group_by': {'default': None, 'items': {'type': 'string'}, 'type': ['string', 'array']}, 'group_method': {'default': 'max', 'type': 'string'}, 'name': {'type': 'string'}, 'sort_by': {'default': None, 'items': {'type': 'string'}, 'type': ['string', 'array']}, 'transpose': {'default': False, 'type': 'boolean'}, 'where': {'items': {'type': 'string'}, 'type': 'array'}}, 'required': ['name'], 'type': 'object'}, 'type': 'array'}, 'tags': {'default': [], 'items': {'type': 'string'}, 'type': 'array'}, 'template': {'type': 'boolean'}, 'variables': {'additionalProperties': True, 'default': {}, 'properties': {}, 'type': ['object', 'null']}, 'variants': {'additionalProperties': True, 'default': {}, 'properties': {}, 'type': ['object', 'null']}, 'zips': {'additionalProperties': {'default': [], 'items': {'type': 'string'}, 'type': 'array'}, 'default': {}, 'properties': {}, 'type': 'object'}}, 'type': 'object'}, 'default': {}, 'properties': {}, 'type': 'object'}, 'formatted_executables': {'additionalProperties': {'additionalProperties': False, 'default': {}, 'properties': {'commands': {'default': ['{unformatted_command}'], 'items': {'type': 'string'}, 'type': 'array'}, 'indentation': {'default': 0, 'type': 'number'}, 'join_separator': {'default': '\n', 'type': 'string'}, 'prefix': {'default': '', 'type': 'string'}}, 'type': 'object'}, 'default': {}, 'properties': {}, 'type': 'object'}, 'internals': {'additionalProperties': False, 'default': {}, 'properties': {'custom_executables': {'additionalProperties': {'default': {'force': False, 'output_capture': OUTPUT_CAPTURE.ALL, 'redirect': '{log_file}', 'template': [], 'use_mpi': False, 'variables': {}}, 'properties': {'force': {'type': 'boolean'}, 'redirect': {'anyOf': [{'type': 'string'}, {'type': 'number'}]}, 'template': {'anyOf': [{'type': 'string'}, {'type': 'number'}, {'default': [], 'items': {'anyOf': [{'type': 'string'}, {'type': 'number'}]}, 'type': 'array'}]}, 'use_mpi': {'type': 'boolean'}, 'variables': {'additionalProperties': True, 'default': {}, 'properties': {}, 'type': ['object', 'null']}}, 'type': 'object'}, 'default': {}, 'properties': {}, 'type': 'object'}, 'executable_injection': {'default': [], 'items': {'additionalProperties': {'relative_to': {'type': 'string'}}, 'default': {}, 'properties': {'name': {'type': 'string'}, 'order': {'default': 'after', 'type': 'string'}}, 'type': 'object'}, 'type': 'array'}, 'executables': {'default': [], 'items': {'anyOf': [{'type': 'string'}, {'type': 'number'}]}, 'type': 'array'}}, 'type': 'object'}, 'modifiers': {'default': [], 'items': {'additionalProperties': False, 'default': {}, 'properties': {'mode': {'type': 'string'}, 'name': {'type': 'string'}, 'on_executable': {'default': [], 'items': {'type': 'string'}, 'type': 'array'}}, 'type': 'object'}, 'type': 'array'}, 'success_criteria': {'default': [], 'items': {'additionalProperties': False, 'default': {}, 'properties': {'anti_match': {'default': None, 'type': 'string'}, 'file': {'default': None, 'type': 'string'}, 'fom_context': {'default': None, 'type': 'string'}, 'fom_name': {'default': None, 'type': 'string'}, 'formula': {'default': None, 'type': 'string'}, 'match': {'default': None, 'type': 'string'}, 'mode': {'type': 'string'}, 'name': {'type': 'string'}}, 'type': 'object'}, 'type': 'array'}, 'tables': {'default': [], 'items': {'additionalProperties': False, 'properties': {'autocolumns': {'items': {'additionalProperties': False, 'properties': {'context_name': {'type': 'string'}, 'figure_of_merit': {'type': 'string'}, 'figure_of_merit_origin_type': {'default': None, 'type': 'string'}, 'name': {'type': 'string'}, 'sort_by': {'default': None, 'items': {'type': 'string'}, 'type': ['string', 'array']}, 'where': {'items': {'type': 'string'}, 'type': 'array'}}, 'required': ['name', 'figure_of_merit'], 'type': 'object'}, 'type': 'array'}, 'columns': {'items': {'additionalProperties': False, 'properties': {'expression': {'default': None, 'type': 'string'}, 'figure_of_merit': {'default': None, 'type': 'string'}, 'figure_of_merit_context': {'default': None, 'type': 'string'}, 'figure_of_merit_origin_type': {'default': None, 'type': 'string'}, 'name': {'type': 'string'}, 'where': {'items': {'type': 'string'}, 'type': 'array'}}, 'required': ['name'], 'type': 'object'}, 'type': 'array'}, 'group_by': {'default': None, 'items': {'type': 'string'}, 'type': ['string', 'array']}, 'group_method': {'default': 'max', 'type': 'string'}, 'name': {'type': 'string'}, 'sort_by': {'default': None, 'items': {'type': 'string'}, 'type': ['string', 'array']}, 'transpose': {'default': False, 'type': 'boolean'}, 'where': {'items': {'type': 'string'}, 'type': 'array'}}, 'required': ['name'], 'type': 'object'}, 'type': 'array'}, 'tags': {'default': [], 'items': {'type': 'string'}, 'type': 'array'}, 'template': {'type': 'boolean'}, 'variables': {'additionalProperties': True, 'default': {}, 'properties': {}, 'type': ['object', 'null']}, 'variants': {'additionalProperties': True, 'default': {}, 'properties': {}, 'type': ['object', 'null']}, 'zips': {'additionalProperties': {'default': [], 'items': {'type': 'string'}, 'type': 'array'}, 'default': {}, 'properties': {}, 'type': 'object'}}, 'type': 'object'}, 'default': {}, 'properties': {}, 'type': 'object'}, 'zips': {'additionalProperties': {'default': [], 'items': {'type': 'string'}, 'type': 'array'}, 'default': {}, 'properties': {}, 'type': 'object'}}, 'type': 'object'}, 'default': {}, 'properties': {}, 'type': 'object'}, 'base_application_repos': {'default': [], 'items': {'type': 'string'}, 'type': 'array'}, 'base_class_repos': {'default': [], 'items': {'type': 'string'}, 'type': 'array'}, 'base_modifier_repos': {'default': [], 'items': {'type': 'string'}, 'type': 'array'}, 'base_package_manager_repos': {'default': [], 'items': {'type': 'string'}, 'type': 'array'}, 'base_platform_repos': {'default': [], 'items': {'type': 'string'}, 'type': 'array'}, 'base_system_repos': {'default': [], 'items': {'type': 'string'}, 'type': 'array'}, 'base_workflow_manager_repos': {'default': [], 'items': {'type': 'string'}, 'type': 'array'}, 'config': {'aggregate_warnings': {'default': False, 'type': 'boolean'}, 'default': {}, 'deprecatedProperties': {'error': False, 'message': 'config:module_roots has been replaced by modules:[module set]:roots and is ignored', 'properties': ['module_roots']}, 'disable_logger': {'default': False, 'type': 'boolean'}, 'disable_passthrough': {'default': False, 'type': 'boolean'}, 'disable_progress_bar': {'default': False, 'type': 'boolean'}, 'enable_strict_versions': {'default': True, 'type': 'boolean'}, 'enable_workspace_prompt': {'default': False, 'type': 'boolean'}, 'input_cache': {'default': '$ramble/var/ramble/cache', 'type': 'string'}, 'n_repeats': {'default': '0', 'type': 'string'}, 'overwrite_inventories': {'default': False, 'type': 'boolean'}, 'pip': {'additionalProperties': False, 'default': {'install': {'flags': []}}, 'properties': {'install': {'additionalProperties': False, 'properties': {'flags': {'default': [], 'items': {'type': 'string'}, 'type': 'array'}}, 'type': 'object'}}, 'type': 'object'}, 'properties': {'additional_external_search_paths': {'items': {'type': 'string'}, 'type': 'array'}, 'allow_sgid': {'type': 'boolean'}, 'binary_index_root': {'type': 'string'}, 'build_jobs': {'minimum': 1, 'type': 'integer'}, 'build_language': {'type': 'string'}, 'build_stage': {'oneOf': [{'type': 'string'}, {'items': {'type': 'string'}, 'type': 'array'}]}, 'ccache': {'type': 'boolean'}, 'checksum': {'type': 'boolean'}, 'concretizer': {'enum': ['original', 'clingo'], 'type': 'string'}, 'connect_timeout': {'minimum': 0, 'type': 'integer'}, 'db_lock_timeout': {'minimum': 1, 'type': 'integer'}, 'debug': {'type': 'boolean'}, 'deprecated': {'type': 'boolean'}, 'dirty': {'type': 'boolean'}, 'extensions': {'items': {'type': 'string'}, 'type': 'array'}, 'install_hash_length': {'minimum': 1, 'type': 'integer'}, 'install_missing_compilers': {'type': 'boolean'}, 'install_path_scheme': {'type': 'string'}, 'install_tree': {'anyOf': [{'properties': {'padded_length': {'oneOf': [{'minimum': 0, 'type': 'integer'}, {'type': 'boolean'}]}, 'projections': {'patternProperties': {'all|\\w[\\w-]*': {'type': 'string'}}, 'type': 'object'}, 'root': {'type': 'string'}}, 'type': 'object'}, {'type': 'string'}]}, 'license_dir': {'type': 'string'}, 'locks': {'type': 'boolean'}, 'misc_cache': {'type': 'string'}, 'package_lock_timeout': {'anyOf': [{'minimum': 1, 'type': 'integer'}, {'type': 'null'}]}, 'shared_linking': {'enum': ['rpath', 'runpath'], 'type': 'string'}, 'source_cache': {'type': 'string'}, 'suppress_gpg_warnings': {'type': 'boolean'}, 'template_dirs': {'items': {'type': 'string'}, 'type': 'array'}, 'test_stage': {'type': 'string'}, 'url_fetch_method': {'enum': ['urllib', 'curl'], 'type': 'string'}, 'verify_ssl': {'type': 'boolean'}}, 'repeat_success_strict': {'default': True, 'type': 'boolean'}, 'report_dirs': {'default': '~/.ramble/reports', 'type': 'string'}, 'shell': {'enum': ['sh', 'bash', 'csh', 'tcsh', 'fish'], 'type': 'string'}, 'spack': {'additionalProperties': False, 'default': {'concretize': {'flags': '--fresh'}, 'install': {'flags': '--fresh'}}, 'flags': {}, 'properties': {'buildcache': {'additionalProperties': False, 'default': {'flags': '', 'prefix': ''}, 'properties': {'flags': {'default': '', 'type': 'string'}, 'prefix': {'default': '', 'type': 'string'}}, 'type': 'object'}, 'compiler_find': {'default': {'flags': '', 'prefix': ''}, 'properties': {'flags': {'default': '', 'type': 'string'}, 'prefix': {'default': '', 'type': 'string'}}, 'type': 'object'}, 'concretize': {'additionalProperties': False, 'default': {'flags': '--fresh', 'prefix': ''}, 'properties': {'flags': {'default': '--fresh', 'type': 'string'}, 'prefix': {'default': '', 'type': 'string'}}, 'type': 'object'}, 'env_create': {'additionalProperties': False, 'default': {'flags': ''}, 'properties': {'flags': {'default': '', 'type': 'string'}}, 'type': 'object'}, 'env_view': {'additionalProperties': False, 'default': {'link_type': 'symlink'}, 'properties': {'link_type': {'default': 'symlink', 'type': 'string'}}, 'type': 'object'}, 'global': {'additionalProperties': False, 'default': {'flags': ''}, 'properties': {'flags': {'default': '', 'type': 'string'}}, 'type': 'object'}, 'install': {'additionalProperties': False, 'default': {'flags': '--fresh', 'prefix': ''}, 'properties': {'flags': {'default': '--fresh', 'type': 'string'}, 'prefix': {'default': '', 'type': 'string'}}, 'type': 'object'}, 'resolve_variables_in_subprocesses': {'additionalProperties': False, 'default': False, 'type': 'boolean'}}, 'type': 'object'}, 'stage_method': {'default': 'cp', 'enum': ['cp', 'rsync', 'symbolic_link', 'hard_link'], 'type': 'string'}, 'suppress_warnings': {'default': False, 'type': 'boolean'}, 'type': 'object', 'upload': {'properties': {'push_failed': {'default': True, 'type': 'boolean'}, 'type': {'default': 'BigQuery', 'enum': ['BigQuery', 'PrintOnly', 'SQLite'], 'type': 'string'}, 'uri': {'default': '', 'type': 'string'}}, 'type': 'object'}, 'user': {'default': '', 'type': 'string'}, 'workspace_dirs': {'default': '$ramble/var/ramble/workspaces', 'items': {'type': 'string'}, 'type': ['string', 'array']}}, 'env_vars': {'append': {'items': {'additionalProperties': {}, 'properties': {'paths': {'patternProperties': {'\\w[\\w-]*': {'anyOf': [{'type': 'string'}, {'type': 'number'}]}}, 'type': 'object'}, 'var-separator': {'type': 'string'}, 'vars': {'patternProperties': {'\\w[\\w-]*': {'anyOf': [{'type': 'string'}, {'type': 'number'}]}}, 'type': 'object'}}, 'type': 'object'}, 'type': 'array'}, 'prepend': {'items': {'additionalProperties': {}, 'properties': {'paths': {'patternProperties': {'\\w[\\w-]*': {'anyOf': [{'type': 'string'}, {'type': 'number'}]}}, 'type': 'object'}}, 'type': 'object'}, 'type': 'array'}, 'set': {'patternProperties': {'\\w[\\w-]*': {'anyOf': [{'type': 'string'}, {'type': 'number'}]}}, 'type': 'object'}, 'unset': {'default': [], 'items': {'anyOf': [{'type': 'string'}, {'type': 'number'}]}, 'type': 'array'}}, 'formatted_executables': {'additionalProperties': {'additionalProperties': False, 'default': {}, 'properties': {'commands': {'default': ['{unformatted_command}'], 'items': {'type': 'string'}, 'type': 'array'}, 'indentation': {'default': 0, 'type': 'number'}, 'join_separator': {'default': '\n', 'type': 'string'}, 'prefix': {'default': '', 'type': 'string'}}, 'type': 'object'}, 'default': {}, 'properties': {}, 'type': 'object'}, 'include': {'default': [], 'items': {'type': 'string'}, 'type': 'array'}, 'internals': {'additionalProperties': False, 'default': {}, 'properties': {'custom_executables': {'additionalProperties': {'default': {'force': False, 'output_capture': OUTPUT_CAPTURE.ALL, 'redirect': '{log_file}', 'template': [], 'use_mpi': False, 'variables': {}}, 'properties': {'force': {'type': 'boolean'}, 'redirect': {'anyOf': [{'type': 'string'}, {'type': 'number'}]}, 'template': {'anyOf': [{'type': 'string'}, {'type': 'number'}, {'default': [], 'items': {'anyOf': [{'type': 'string'}, {'type': 'number'}]}, 'type': 'array'}]}, 'use_mpi': {'type': 'boolean'}, 'variables': {'additionalProperties': True, 'default': {}, 'properties': {}, 'type': ['object', 'null']}}, 'type': 'object'}, 'default': {}, 'properties': {}, 'type': 'object'}, 'executable_injection': {'default': [], 'items': {'additionalProperties': {'relative_to': {'type': 'string'}}, 'default': {}, 'properties': {'name': {'type': 'string'}, 'order': {'default': 'after', 'type': 'string'}}, 'type': 'object'}, 'type': 'array'}, 'executables': {'default': [], 'items': {'anyOf': [{'type': 'string'}, {'type': 'number'}]}, 'type': 'array'}}, 'type': 'object'}, 'licenses': {'additionalProperties': {'additionalProperties': False, 'default': {}, 'properties': {'append': {'items': {'additionalProperties': {}, 'properties': {'paths': {'patternProperties': {'\\w[\\w-]*': {'anyOf': [{'type': 'string'}, {'type': 'number'}]}}, 'type': 'object'}, 'var-separator': {'type': 'string'}, 'vars': {'patternProperties': {'\\w[\\w-]*': {'anyOf': [{'type': 'string'}, {'type': 'number'}]}}, 'type': 'object'}}, 'type': 'object'}, 'type': 'array'}, 'prepend': {'items': {'additionalProperties': {}, 'properties': {'paths': {'patternProperties': {'\\w[\\w-]*': {'anyOf': [{'type': 'string'}, {'type': 'number'}]}}, 'type': 'object'}}, 'type': 'object'}, 'type': 'array'}, 'set': {'patternProperties': {'\\w[\\w-]*': {'anyOf': [{'type': 'string'}, {'type': 'number'}]}}, 'type': 'object'}, 'unset': {'default': [], 'items': {'anyOf': [{'type': 'string'}, {'type': 'number'}]}, 'type': 'array'}}, 'type': 'object'}, 'default': {}, 'properties': {}, 'type': 'object'}, 'mirrors': {'additionalProperties': False, 'default': {}, 'patternProperties': {'\\w[\\w-]*': {'anyOf': [{'type': 'string'}, {'properties': {'fetch': {'type': ['string', 'object']}, 'push': {'type': ['string', 'object']}}, 'required': ['fetch', 'push'], 'type': 'object'}]}}, 'type': 'object'}, 'modifier_repos': {'default': [], 'items': {'type': 'string'}, 'type': 'array'}, 'modifiers': {'default': [], 'items': {'additionalProperties': False, 'default': {}, 'properties': {'mode': {'type': 'string'}, 'name': {'type': 'string'}, 'on_executable': {'default': [], 'items': {'type': 'string'}, 'type': 'array'}}, 'type': 'object'}, 'type': 'array'}, 'package_manager_repos': {'default': [], 'items': {'type': 'string'}, 'type': 'array'}, 'platform_repos': {'default': [], 'items': {'type': 'string'}, 'type': 'array'}, 'repos': {'default': [], 'items': {'type': 'string'}, 'type': 'array'}, 'software': {'additionalProperties': False, 'default': {}, 'properties': {'environments': {'additionalProperties': {'additionalProperties': {'type': 'string'}, 'default': {}, 'properties': {'external_env': {'default': None, 'type': 'string'}, 'packages': {'default': [], 'items': {'type': 'string'}, 'type': 'array'}}, 'type': 'object'}, 'default': {}, 'properties': {}, 'type': 'object'}, 'packages': {'additionalProperties': {'additionalProperties': True, 'default': {}, 'properties': {'compiler': {'default': None, 'type': 'string'}, 'compiler_spec': {'default': None, 'type': 'string'}, 'pkg_spec': {'type': 'string'}}, 'type': 'object'}, 'type': 'object'}}, 'type': 'object'}, 'success_criteria': {'default': [], 'items': {'additionalProperties': False, 'default': {}, 'properties': {'anti_match': {'default': None, 'type': 'string'}, 'file': {'default': None, 'type': 'string'}, 'fom_context': {'default': None, 'type': 'string'}, 'fom_name': {'default': None, 'type': 'string'}, 'formula': {'default': None, 'type': 'string'}, 'match': {'default': None, 'type': 'string'}, 'mode': {'type': 'string'}, 'name': {'type': 'string'}}, 'type': 'object'}, 'type': 'array'}, 'system_repos': {'default': [], 'items': {'type': 'string'}, 'type': 'array'}, 'tables': {'default': [], 'items': {'additionalProperties': False, 'properties': {'autocolumns': {'items': {'additionalProperties': False, 'properties': {'context_name': {'type': 'string'}, 'figure_of_merit': {'type': 'string'}, 'figure_of_merit_origin_type': {'default': None, 'type': 'string'}, 'name': {'type': 'string'}, 'sort_by': {'default': None, 'items': {'type': 'string'}, 'type': ['string', 'array']}, 'where': {'items': {'type': 'string'}, 'type': 'array'}}, 'required': ['name', 'figure_of_merit'], 'type': 'object'}, 'type': 'array'}, 'columns': {'items': {'additionalProperties': False, 'properties': {'expression': {'default': None, 'type': 'string'}, 'figure_of_merit': {'default': None, 'type': 'string'}, 'figure_of_merit_context': {'default': None, 'type': 'string'}, 'figure_of_merit_origin_type': {'default': None, 'type': 'string'}, 'name': {'type': 'string'}, 'where': {'items': {'type': 'string'}, 'type': 'array'}}, 'required': ['name'], 'type': 'object'}, 'type': 'array'}, 'group_by': {'default': None, 'items': {'type': 'string'}, 'type': ['string', 'array']}, 'group_method': {'default': 'max', 'type': 'string'}, 'name': {'type': 'string'}, 'sort_by': {'default': None, 'items': {'type': 'string'}, 'type': ['string', 'array']}, 'transpose': {'default': False, 'type': 'boolean'}, 'where': {'items': {'type': 'string'}, 'type': 'array'}}, 'required': ['name'], 'type': 'object'}, 'type': 'array'}, 'variables': {'additionalProperties': True, 'default': {}, 'properties': {}, 'type': ['object', 'null']}, 'variants': {'additionalProperties': True, 'default': {}, 'properties': {}, 'type': ['object', 'null']}, 'workflow_manager_repos': {'default': [], 'items': {'type': 'string'}, 'type': 'array'}, 'zips': {'additionalProperties': {'default': [], 'items': {'type': 'string'}, 'type': 'array'}, 'default': {}, 'properties': {}, 'type': 'object'}}, 'type': 'object'}}, 'title': 'Ramble workspace configuration file schema', 'type': 'object'}

Config file information for workspaces. Keys are filenames, values are dictionaries describing the config files.

ramble.workspace.workspace.create(name, read_default_template=True, parent_dir=None)[source]

Create a named workspace in Ramble

ramble.workspace.workspace.deactivate()[source]

Undo any configuration settings modified by activate().

ramble.workspace.workspace.deactivate_config_scope(workspace)[source]

Remove any scopes from workspace from the global config path.

ramble.workspace.workspace.exists(name, parent_dir=None)[source]

Whether a workspace with this name exists or not.

ramble.workspace.workspace.get_filepath(path, file_name)[source]
ramble.workspace.workspace.get_workspace(args, cmd_name, required=False)[source]

Used by commands to get the active workspace.

This first checks for a workspace argument, then looks at the active workspace. We check args first because Ramble’s subcommand arguments are parsed after the -s and -D arguments to ramble. So there may be a workspace argument that is not the active workspace, and we give it precedence.

This is used by a number of commands for determining whether there is an active workspace.

If a workspace is not found and is required, print an error message that says the calling command needs an active workspace.

Parameters:
  • args (ramble.namespace) – argparse namespace with command arguments

  • cmd_name (str) – name of calling command

  • required (bool) – if True, raise an exception when no workspace is found; if False, just return None

Returns:

if there is an arg or active workspace

Return type:

(Workspace)

ramble.workspace.workspace.get_workspace_path()[source]

Returns current directory of ramble-managed workspaces

ramble.workspace.workspace.is_workspace_dir(path)[source]

Whether a directory contains a ramble workspace.

ramble.workspace.workspace.licenses_file(path)[source]

Returns the path to a workspace’s licenses.yaml

ramble.workspace.workspace.no_active_workspace()[source]

Deactivate the active workspace for the duration of the context. Has no effect when there is no active workspace.

ramble.workspace.workspace.prepare_config_scope(workspace)[source]

Add workspace’s scope to the global configuration search path.

ramble.workspace.workspace.read(name)[source]

Get a workspace with the supplied name.

ramble.workspace.workspace.root(name, parent_dir=None)[source]

Get the root directory for a workspace by name.

ramble.workspace.workspace.template_path(ws_path, requested_template_name)[source]

Returns the path to a workspace’s template file

ramble.workspace.workspace.valid_workspace_name(name)[source]
ramble.workspace.workspace.validate_workspace_name(name)[source]
ramble.workspace.workspace.yaml_equivalent(first, second)[source]

Returns whether two ramble yaml items are equivalent, including overrides