File Path Management
- class vivarium.cluster_tools.psimulate.paths.InputPaths(model_specification, branch_configuration, artifact, result_directory)[source]
Container class for input filepaths.
In addition to the path attributes, this class provides a method to create the required directories.
- Parameters:
-
result_directory:
Path The path to the results directory.
- classmethod from_entry_point_args(*, result_directory, input_model_specification_path=None, input_branch_configuration_path=None, input_artifact_path=None)[source]
Create an instance of InputPaths from the arguments passed to the entry point.
- Return type:
- Parameters:
result_directory (str | Path) – The path to the results directory.
input_model_specification_path (str | Path | None) – The path to the model specification file.
input_branch_configuration_path (str | Path | None) – The path to the branch configuration file.
input_artifact_path (str | Path | None) – The path to the data artifact.
- Returns:
An instance of InputPaths.
- class vivarium.cluster_tools.psimulate.paths.OutputPaths(root, logging_root, worker_logging_root, metadata_dir, environment_file, model_specification, keyspace, branches, results_dir, backup_dir, backup_metadata_path)[source]
Container class for output filepaths.
In addition to the path attributes, this class provides a method to create the required directories as well as a class method to create an instance from the arguments passed to the entry point.
- Parameters:
-
root:
Path The timestamped root directory for the simulation output.
-
logging_root:
Path The parent directory for all logs.
-
worker_logging_root:
Path The root directory for worker logs.
-
metadata_dir:
Path The directory for task metadata JSON files.
-
environment_file:
Path The path to the requirements.txt environment file.
-
model_specification:
Path The path to the model specification file.
-
keyspace:
Path The path to the simulation keyspace file.
-
branches:
Path The path to the simulation branches file.
-
results_dir:
Path The path to the results directory.
-
backup_dir:
Path The path to the simulation backup directory.
-
backup_metadata_path:
Path The path to the backup metadata file.
- property logging_to_central_results_directory: bool
Whether the logs are being written to the central results directory.
- classmethod from_entry_point_args(*, command, input_artifact_path, result_directory, input_model_spec_path, launch_time=None, is_resume=False)[source]
Create an instance of OutputPaths from the arguments passed to the entry point.
- Return type:
- Parameters:
command (str) – The specific
psimulatecommand being run.input_artifact_path (Path | None) – The path to the data artifact.
result_directory (Path) – The path to the results directory.
input_model_spec_path (Path | None) – The path to the model specification file.
launch_time (str | None) – Optional timestamp string (
YYYY_MM_DD_HH_MM_SS). When provided, this timestamp is used for directory naming instead of generating a new one fromdatetime.now(). This ensures that all steps in a workflow share the same timestamp, and that resume builds produce identical paths.is_resume (bool) – If True, generates a fresh timestamp for the logging directory so that each resume attempt gets its own logs, mirroring
psimulate restartbehavior. The output root still useslaunch_time.
- Returns:
An instance of OutputPaths.