Configuration Bootstrapping¶
This page documents the REvoDesign.bootstrap module, which initialises the REvoDesign configuration system using Hydra and OmegaConf. It handles copying the template configuration tree to the user's data directory, verifying and repairing the config structure, saving and reloading config files, and managing experiment and cache directories.
Module-Level Constants¶
These constants are set at import time by REvoDesign.bootstrap.__init__:
REVODESIGN_CONFIG_FILE(str) -- Absolute path to the user'smain.yamlconfiguration file, determined byset_REvoDesign_config_file().REVODESIGN_CONFIG_DIR(str) -- Directory containing all user configuration YAML files (os.path.dirname(REVODESIGN_CONFIG_FILE)).EXPERIMENTS_CONFIG_DIR(str) -- Directory for experiment-specific configuration files, created byexperiment_config("experiments").CACHE_CONFIG_DIR(str) -- Directory for cached intermediate YAML files, created byexperiment_config("cache"). Note: set as a module-level variable but not included in__all__; import viafrom REvoDesign.bootstrap import CACHE_CONFIG_DIR.
Functions¶
REvoDesign.bootstrap.set_config.set_REvoDesign_config_file(delete_user_config_tree=False)
¶
Sets the REvoDesign configuration directory. If the main configuration file does not exist, it will be copied from the template directory. If the configuration directory exists, it will also be checked for potential issues.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
delete_user_config_tree
|
bool
|
Whether to delete the user's configuration tree. Defaults to False. |
False
|
Returns:
| Name | Type | Description |
|---|---|---|
str |
The path to the REvoDesign configuration directory. |
REvoDesign.bootstrap.set_config.reload_config_file(config_name='main', overrides=None, return_hydra_config=False)
¶
Reload a configuration yaml file in a Hydra manner. As we initialize hydra w/ initialize_config_dir,
which is the REVODESIGN_CONFIG_DIR at user's data directory, the config_name is supposed as a relative path of the yaml file.
e.g. config_name="experiments/my_experiment" refers to experiments/my_experiment.yaml
the DictConfig object can be accessed like reload_config_file(config_name="experiments/my_experiment")["experiments"]
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config_name
|
str
|
The name of the configuration file. Defaults to "main". |
'main'
|
overrides
|
list[str]
|
A list of overrides to apply to the configuration. Defaults to None. |
None
|
return_hydra_config
|
bool
|
Whether to return the Hydra configuration. Defaults to False. |
False
|
REvoDesign.bootstrap.set_config.save_configuration(new_cfg, config_name='main')
¶
Save configuration to specified directory
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
new_cfg
|
DictConfig
|
The configuration object to be saved |
required |
config_name
|
str
|
Configuration file name, defaults to "main" |
'main'
|
Returns:
| Type | Description |
|---|---|
|
None |
REvoDesign.bootstrap.set_config.experiment_config(name='experiments')
¶
Create and return the path to the experiment configuration directory.
This function creates an experiment directory based on the global configuration directory and the specified name. If the directory doesn't exist, it automatically creates it, ensuring the directory exists before returning its full path.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
The name of the experiment directory, defaults to "experiments" |
'experiments'
|
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The full path to the experiment directory |
REvoDesign.bootstrap.set_config.set_cache_dir()
¶
REvoDesign.bootstrap.set_config.verify_config_tree_structure(user_config_dir, template_config_dir)
¶
Ensures every YAML file in the template tree exists in the user's config directory. Missing files are copied over, preserving the relative directory structure.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
user_config_dir
|
str
|
Path to the user's configuration directory where files should be present |
required |
template_config_dir
|
str
|
Path to the template configuration directory containing reference files |
required |
Returns:
| Type | Description |
|---|---|
list[str]
|
list[str]: List of relative paths of files that were copied from template to user config directory |
REvoDesign.bootstrap.set_config.enforce_config_key_structure(user_config_dir, template_config_dir)
¶
Compares YAML files between template and user directories and replaces files whose key structure differs from the template.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
user_config_dir
|
str
|
Path to the user configuration directory |
required |
template_config_dir
|
str
|
Path to the template configuration directory |
required |
Returns:
| Type | Description |
|---|---|
list[str]
|
list[str]: Returns a list of relative paths of files that were replaced |
Classes¶
REvoDesign.bootstrap.set_config.ConfigConverter
¶
A utility class to convert omegaconf.DictConfig objects to standard Python dictionaries. This conversion is done recursively to handle nested DictConfig objects.
convert(config)
staticmethod
¶
Converts an omegaconf.DictConfig object to a standard Python dictionary.
Usage
converted_dict = ConfigConverter.convert(dict_config)
:param config: The DictConfig object to convert. :return: A standard Python dictionary representation of the input DictConfig.
Config YAML Schema¶
The configuration tree lives under src/REvoDesign/config/ as the template and is copied to the user's platform data directory (platformdirs.user_data_dir("REvoDesign")/config). The directory structure is:
Top-Level Files¶
| File | Purpose |
|---|---|
main.yaml |
Primary configuration for UI widgets, design parameters, file paths, and algorithm settings. This is the file the user edits most often. |
environ.yaml |
Environment variable overrides and build-time flags (e.g., paths to third-party executables). Ignored by enforce_config_key_structure to allow local customisation. |
logger.yaml |
Logging system configuration (log levels, handlers, formatters). |
openmm.yaml |
OpenMM simulation setup parameters (force fields, integrator, thermostats). |
runtime.yaml |
Runtime-specific configuration for plugin operation mode. |
Subdirectory Presets¶
rfdiffusion/ -- Parameter presets for RFdiffusion, organised by use case:
base.yaml-- Default diffusion parameters.enzyme.yaml-- Enzyme-specific diffusion settings.motif_scaffoldding.yaml-- Motif scaffolding parameters.partial_diffusion.yaml-- Partial diffusion configuration.symmetry.yaml-- Symmetric diffusion settings.
rosetta-node/ -- Rosetta execution presets for different deployment modes:
native.yaml-- Native (local) Rosetta execution.docker.yaml/docker_mpi.yaml-- Docker-based execution (serial and MPI).wsl.yaml/wsl_mpi.yaml-- WSL-based execution (serial and MPI).mpi.yaml-- General MPI execution.
sidechain-solver/ -- Sidechain solver configurations:
pippack.yaml-- PIPPack configuration for sidechain packing.diffpack.yaml-- DiffPack configuration for diffusion-based packing.dlpacker_pytorch.yaml-- DLPacker PyTorch configuration.
third_party/scorers/ -- Third-party scorer API configurations:
openkinetics_api.yaml-- OpenKinetics REST API endpoint and authentication settings.