utils
Utility functions for IRDL.
-
irdl.utils._fits_in_memory(ingest_path: Path) → bool
Check if a file can be loaded into available RAM.
Needed when an entire dataset is loaded into memory.
- Parameters:
- ingest_path
Path Path to the ingestable file.
- Returns:
- fitsbool
True if the file fits into available RAM with headroom.
-
irdl.utils._validate_hash_registry(provider_name: str, registry: object) → None
Validate the common flat hash-registry schema.
- Parameters:
- provider_name
str Provider identifier used in error messages.
- registry
object Parsed JSON payload to validate.
- Raises:
ValueErrorIf the registry does not match the required flat dict[str, str] schema.
-
irdl.utils.load_hash_registry(provider_name: str) → dict[str, str]
Load and validate a packaged provider hash registry.
- Parameters:
- provider_name
str Provider identifier used to resolve <provider_name>_hashes.json from
irdl/registry/ package data.
- Returns:
dictFlat mapping of provider-relative paths to sha256:... digests.