plaid.infos¶
plaid.infos
¶
Pydantic models and helpers for dataset infos metadata.
plaid.infos.DataProduction
¶
Dataset production context metadata.
plaid.infos.Infos
¶
Structured representation of a PLAID dataset infos payload.
plaid.infos.Infos.print_available_fields
classmethod
¶
Print the public constructor fields accepted by :class:Infos.
Source code in plaid/infos.py
plaid.infos.Infos.require_persisted
¶
Validate fields that must exist in persisted dataset infos.
num_samples and storage_backend are derived by storage writers
when a dataset is saved, so they are optional while users prepare an
Infos object. Once infos are loaded from disk or the Hub, however,
readers need both fields to select the backend and split sizes.
Source code in plaid/infos.py
plaid.infos.Infos.validate_authorized_only
classmethod
¶
Validate schema/authorized keys without enforcing required sections.
Source code in plaid/infos.py
plaid.infos.Infos.validate_required_only
classmethod
¶
plaid.infos.Infos.validate_persisted
classmethod
¶
Validate and return complete infos loaded from persisted storage.
plaid.infos.Infos.normalize_mapping
classmethod
¶
Validate and return a normalized deep copy of infos.
plaid.infos.Infos.from_path
classmethod
¶
Load and validate an :class:Infos from a YAML file.
Parameters:
-
path(Union[str, Path]) –Path to the YAML file (typically
infos.yaml). If no suffix is provided,.yamlis appended. -
require_persisted(bool, default:True) –When True, require storage-derived metadata fields expected in a complete on-disk dataset.
Returns:
-
Validated('Infos') –class:
Infosinstance.
Raises:
-
FileNotFoundError–If the resolved YAML file does not exist.
-
IsADirectoryError–If
pathpoints to a directory.
Source code in plaid/infos.py
plaid.infos.Infos.save_to_file
¶
Save infos to path as a YAML file.
Parameters:
-
path(Union[str, Path]) –File path where the YAML will be written. If no suffix is provided,
.yamlis appended.
Raises:
-
IsADirectoryError–If
pathpoints to a directory.