plaid.storage.common.reader =========================== .. py:module:: plaid.storage.common.reader .. autoapi-nested-parse:: Common storage reader utilities. This module provides common utilities for reading dataset metadata, problem definitions, and other auxiliary files from disk or downloading them from Hugging Face Hub. Functions --------- .. autoapisummary:: plaid.storage.common.reader.load_infos_from_disk plaid.storage.common.reader.load_problem_definitions_from_disk plaid.storage.common.reader.load_metadata_from_disk plaid.storage.common.reader.load_infos_from_hub plaid.storage.common.reader.load_problem_definitions_from_hub plaid.storage.common.reader.load_metadata_from_hub Module Contents --------------- .. py:function:: load_infos_from_disk(path: Union[str, pathlib.Path]) -> dict[str, Any] Load dataset information from a YAML file stored on disk. :param path: Directory path containing the `infos.yaml` file. :type path: Union[str, Path] :returns: Dictionary containing dataset infos. :rtype: dict[str, dict[str, str]] .. py:function:: load_problem_definitions_from_disk(path: Union[str, pathlib.Path]) -> Optional[list[plaid.ProblemDefinition]] Load ProblemDefinitions from disk. :param path: The directory path for loading. :type path: Union[str, Path] :returns: List of loaded problem definitions, or None if not found. :rtype: Optional[list[ProblemDefinition]] .. py:function:: load_metadata_from_disk(path: Union[str, pathlib.Path]) -> tuple[dict[str, Any], dict[str, Any], dict[str, Any], dict[str, Any]] Load dataset metadata from disk. :param path: Directory path containing the metadata files. :type path: Union[str, Path] :returns: - flat_cst: constant features dictionary - variable_schema: variable schema dictionary - constant_schema: constant schema dictionary - cgns_types: CGNS types dictionary :rtype: tuple[dict[str, Any], dict[str, Any], dict[str, Any], dict[str, Any]] .. py:function:: load_infos_from_hub(repo_id: str) -> dict[str, Any] Load dataset infos from the Hugging Face Hub. Downloads the infos.yaml file from the specified repository and parses it as a dictionary. :param repo_id: The repository ID on the Hugging Face Hub. :type repo_id: str :returns: Dictionary containing dataset infos. :rtype: dict[str, dict[str, str]] .. py:function:: load_problem_definitions_from_hub(repo_id: str) -> Optional[list[plaid.ProblemDefinition]] Load ProblemDefinitions from Hugging Face Hub. :param repo_id: The repository ID on the Hugging Face Hub. :type repo_id: str :returns: List of loaded problem definitions, or None if not found. :rtype: Optional[list[ProblemDefinition]] .. py:function:: load_metadata_from_hub(repo_id: str) -> tuple[dict[str, Any], dict[str, Any], dict[str, Any], dict[str, Any]] Load dataset metadata from Hugging Face Hub. :param repo_id: The repository ID on the Hugging Face Hub. :type repo_id: str :returns: - flat_cst: constant features dictionary - variable_schema: variable schema dictionary - constant_schema: constant schema dictionary - cgns_types: CGNS types dictionary :rtype: tuple[dict[str, Any], dict[str, Any], dict[str, Any], dict[str, Any]]