CodeEntropy.config.runtime module¶
Run orchestration for CodeEntropy.
This module provides the CodeEntropyRunner, which is responsible for: - Creating a new job folder for each run - Loading YAML configuration and merging it with CLI arguments - Setting up logging and displaying a Rich splash screen - Building the MDAnalysis Universe (including optional force merging) - Wiring dependencies and executing the EntropyWorkflow workflow - Providing physical-constants helpers used by entropy calculations
Notes on design: - CodeEntropyRunner focuses on orchestration and simple utilities only. - Computational logic lives in EntropyWorkflow and the level/entropy DAG modules.
- class CodeEntropy.config.runtime.CodeEntropyRunner(folder: str)[source]¶
Bases:
objectCoordinate setup and execution of entropy analysis runs.
- Responsibilities:
Bootstrapping: job folder, logging, splash screen
Configuration: YAML loading + CLI parsing + merge and validation
Universe creation: MDAnalysis Universe (optionally merging forces)
Dependency wiring and execution: EntropyWorkflow
Utilities used by downstream modules: constants and unit conversions
- Variables:
folder – Working directory for the current job (e.g., job001).
- property DEF_TEMPER: float¶
Return the default temperature (K) used in the analysis.
- property N_AVOGADRO: float¶
Return Avogadro’s number used in entropy calculations.
- change_lambda_units(arg_lambdas: Any) Any[source]¶
Unit of lambdas : kJ2 mol-2 A-2 amu-1 change units of lambda to J/s2
- static create_job_folder() str[source]¶
Create a new job folder (job###) in the current working directory.
The method searches existing folders that start with “job” and picks the next integer suffix. If none exist, it creates job001.
- Returns:
The full path to the newly created job folder.
- load_citation_data() dict[str, Any] | None[source]¶
Load CITATION.cff from GitHub.
If the request fails (offline, blocked, etc.), returns None.
- Returns:
Parsed CITATION.cff content as a dict, or None if unavailable.
- print_args_table(args: Any) None[source]¶
Print a Rich table of the run configuration arguments.
- Parameters:
args – argparse Namespace or object with attributes for configuration.
- read_universe(path: str) MDAnalysis.Universe[source]¶
Read a universe from disk (pickle).
Parameters¶
- pathstr
The path to file.
Returns¶
- uMDAnalysis.Universe
A Universe object will all topology, dihedrals,coordinates and force information.
- run_entropy_workflow() None[source]¶
Run the end-to-end entropy workflow.
This method: - Sets up logging and prints the splash screen - Loads YAML configuration from CWD and parses CLI args - Merges args with YAML per-run config - Optionally submits a master SLURM job and exits - Builds the MDAnalysis Universe (with optional force merging) - Validates user parameters - Constructs dependencies and executes EntropyWorkflow - Saves recorded console output to a log file - Logs run arguments if an error occurs to aid debugging
- Raises:
RuntimeError – If the workflow fails for any reason. The original exception is chained to preserve traceback information.
- write_universe(u: MDAnalysis.Universe, name: str = 'default') str[source]¶
Write a universe to disk as a pickle.
Parameters¶
- uMDAnalyse.Universe
A Universe object will all topology, dihedrals,coordinates and force information
- namestr, Optional. default: ‘default’
The name of file with sub file name .pkl
Returns¶
- namestr
filename of saved universe