plinder.core.utils.io#
Wrap all network requests in a retry decorator and use a convention of looking for a file in a pre-determined location before fetching it from the network.
- plinder.core.utils.io.get_pdb_revision(pdb_or_system_id: str, *, manifest_path: Path | str | None = None) tuple[int, int][source]#
Return the exact source mmCIF revision pinned by this release.
- plinder.core.utils.io.pdb_mmcif_cache_path(pdb_or_system_id: str, *, cache_dir: Path | str | None = None, revision: tuple[int, int] | None = None, manifest_path: Path | str | None = None) Path[source]#
Return the deterministic local path for a version-pinned PDB mmCIF.
- plinder.core.utils.io.get_pdb_mmcif(pdb_or_system_id: str, *, cache_dir: Path | str | None = None, force_update: bool = False, revision: tuple[int, int] | None = None, manifest_path: Path | str | None = None, base_url: str = 'https://files-versioned.wwpdb.org/pdb_versioned/data/entries') Path[source]#
Return the release-pinned source mmCIF, downloading it when allowed.
Online calls populate the release-local cache atomically. In offline mode the function performs no network or filesystem writes: a valid cached file is returned and a missing or corrupt file raises
FileNotFoundError.