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:
  • model_specification (Path | None)

  • branch_configuration (Path | None)

  • artifact (Path | None)

  • result_directory (Path)

model_specification: Path | None

The path to the model specification file.

branch_configuration: Path | None

The path to the branch configuration file.

artifact: Path | None

The path to the data artifact.

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:

InputPaths

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)

  • logging_root (Path)

  • worker_logging_root (Path)

  • metadata_dir (Path)

  • environment_file (Path)

  • model_specification (Path)

  • keyspace (Path)

  • branches (Path)

  • results_dir (Path)

  • backup_dir (Path)

  • backup_metadata_path (Path)

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 artifact_name: str

Name of the artifact.

property run_date: str

Date of the simulation run.

property run_type: str

Type of the simulation run.

property original_run_date: str

Date of the original simulation run.

property project_name: str

Name of the project.

property root_path: str

Path to the root directory.

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)[source]

Create an instance of OutputPaths from the arguments passed to the entry point.

Return type:

OutputPaths

Parameters:
  • command (str) – The specific psimulate command 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.

Returns:

An instance of OutputPaths.

touch()[source]

Create the required directories.

Return type:

None