PICurv 0.1.0
A Parallel Particle-In-Cell Solver for Curvilinear LES
 
Loading...
Searching...
No Matches
Data Structures | Namespaces | Functions | Variables
models.py File Reference

Storage constants, profiles, and the local artifact state marker. More...

Go to the source code of this file.

Data Structures

class  picurv_cli.storage.models.StorageError
 User-facing storage workflow failure. More...
 

Namespaces

namespace  picurv_cli
 
namespace  picurv_cli.storage
 
namespace  picurv_cli.storage.models
 

Functions

str picurv_cli.storage.models._utc_now ()
 Return a stable UTC timestamp for storage metadata.
 
str picurv_cli.storage.models._human_bytes (int value)
 Format a byte count for concise command output.
 
str picurv_cli.storage.models._sha256_file (str path)
 Calculate SHA-256 without loading a potentially large file into memory.
 
None picurv_cli.storage.models._atomic_write_json (str path, dict payload)
 Atomically replace a JSON state or manifest file.
 
 picurv_cli.storage.models._read_json (str path)
 Read a JSON mapping when present, otherwise return None.
 
 picurv_cli.storage.models.read_artifact_manifest (str root_path)
 Read a local artifact's own identity manifest, run or study.
 
dict picurv_cli.storage.models.read_artifact_identity (str root_path)
 Resolve what a local artifact directory is, and what it calls itself.
 
 picurv_cli.storage.models._find_upwards (str start, str filename)
 Find the nearest named file at or above a filesystem anchor.
 
str picurv_cli.storage.models.storage_workspace_root (str start=None)
 Locate the initialized workspace a storage command is standing in.
 
str picurv_cli.storage.models.storage_config_origin (str config_path, str workspace_root=None)
 Classify where an active storage configuration came from.
 
str picurv_cli.storage.models.resolve_storage_config_path (str explicit_path=None, bool require=True)
 Resolve an explicit or nearest workspace storage configuration.
 
dict picurv_cli.storage.models.load_storage_profile (str profile_name=None, str config_path=None)
 Load and validate one non-secret rclone storage profile.
 
str picurv_cli.storage.models._state_path (str root_path)
 Return the local storage state marker path for an artifact root.
 
 picurv_cli.storage.models.read_storage_state (str root_path)
 Read the nearest applicable storage marker for a run, study, or study member.
 
bool picurv_cli.storage.models.is_artifact_cold (str root_path)
 Return whether a local artifact marker says payload data was pruned.
 
dict picurv_cli.storage.models.storage_state_summary (str root_path)
 Return a compact storage status for summarize and status commands.
 
dict picurv_cli.storage.models._parse_tags (raw_tags)
 Parse repeatable KEY=VALUE tags into deterministic metadata.
 

Variables

str picurv_cli.storage.models.STORAGE_CONFIG_FILENAME = ".picurv-storage.yml"
 
str picurv_cli.storage.models.STORAGE_STATE_FILENAME = ".picurv-storage.json"
 
str picurv_cli.storage.models.STORAGE_LOCK_FILENAME = ".picurv-storage.lock.json"
 
int picurv_cli.storage.models.STORAGE_SCHEMA_VERSION = 2
 
str picurv_cli.storage.models.REMOTE_OBJECTS_DIRECTORY = "objects"
 
str picurv_cli.storage.models.REMOTE_BLOBS_DIRECTORY = "blobs"
 
str picurv_cli.storage.models.REMOTE_MANIFEST_FILENAME = "manifest.json"
 
tuple picurv_cli.storage.models.STORAGE_ARTIFACT_TYPES = ("run", "study", "study-case")
 
str picurv_cli.storage.models.RUN_MANIFEST_FILENAME = "manifest.json"
 
str picurv_cli.storage.models.STUDY_MANIFEST_FILENAME = "study_manifest.json"
 
str picurv_cli.storage.models.REMOTE_COMPLETE_FILENAME = "COMPLETE"
 
str picurv_cli.storage.models.DEFAULT_PROFILE_NAME = "archive"
 
float picurv_cli.storage.models.DEFAULT_CHUNK_SIZE_GIB = 8.0
 
 picurv_cli.storage.models.DEFAULT_STORAGE_WORKERS = max(1, min(8, os.cpu_count() or 1))
 
int picurv_cli.storage.models.AUTO_NO_COMPRESSION_BYTES = 256 * 1024 * 1024
 
int picurv_cli.storage.models.AUTO_MAXIMUM_COMPRESSION_BYTES = 20 * 1024 * 1024 * 1024
 
 picurv_cli.storage.models.CHECKPOINT_DIRECTORY_PATTERN = re.compile(r"^step_(\d{12})$")
 
 picurv_cli.storage.models.INCOMPLETE_CHECKPOINT_PATTERN = re.compile(r"^\.step_\d{12}\.incomplete\.")
 
 picurv_cli.storage.models.ARCHIVE_ID_PATTERN = re.compile(r"^[0-9a-f]{32}$")
 
int picurv_cli.storage.models.KNOWN_CHECKPOINT_VERSION = 1
 
str picurv_cli.storage.models.UNCLASSIFIED_COMPONENT = "unclassified"
 
str picurv_cli.storage.models.WORKSPACE_CONFIG_FILENAME = ".picurv-workspace.yml"
 
tuple picurv_cli.storage.models.WORKSPACE_EXCLUDED_ROOTS = ("runs", "studies")
 
 picurv_cli.storage.models.ALWAYS_RETAINED_COMPONENTS
 
tuple picurv_cli.storage.models.STORAGE_RESTORE_COMPONENTS
 
 picurv_cli.storage.models.ALWAYS_RESTORED_COMPONENTS = frozenset({"metadata", "workspace-config"})
 
dict picurv_cli.storage.models._PARALLEL_GZIP_VALUES = {"fast", "balanced"}
 
tuple picurv_cli.storage.models.CLI_OUTPUT_FORMATS = ("text", "json")
 
tuple picurv_cli.storage.models.STORAGE_COMPRESSION_POLICIES = ("auto", "none", "fast", "balanced", "maximum")
 
tuple picurv_cli.storage.models.STORAGE_OFFLOAD_POLICIES = ("metadata-only", "restart-ready", "analysis-ready")
 
tuple picurv_cli.storage.models.STORAGE_RETENTION_COMPONENTS
 
dict picurv_cli.storage.models.STORAGE_COMPRESSION_EXTENSIONS
 

Detailed Description

Storage constants, profiles, and the local artifact state marker.

Definition in file models.py.