curryer.correction.io ===================== .. py:module:: curryer.correction.io .. autoapi-nested-parse:: Unified path resolution for the correction pipeline. All file loading in the correction package should go through resolve_path() to transparently handle local paths and S3 URIs. S3 access follows the same pattern as :mod:`curryer.correction.dataio`: callers may provide an explicit ``s3_client`` (useful for testing) or rely on the default boto3 client. Attributes ---------- .. autoapisummary:: curryer.correction.io.logger Functions --------- .. autoapisummary:: curryer.correction.io.resolve_path Module Contents --------------- .. py:data:: logger .. py:function:: resolve_path(path: str | pathlib.Path, *, s3_client=None) -> pathlib.Path Resolve a file path, downloading from S3 if necessary. :param path: Local file path or S3 URI (``s3://bucket/key``). :type path: str or Path :param s3_client: Injected client for testing. If omitted and *path* is an S3 URI, a default client is created via boto3. :type s3_client: boto3 S3 client, optional :returns: Local file path. For S3 URIs, a temporary local file that is cleaned up at process exit via :func:`atexit`. :rtype: Path :raises ImportError: If *path* is an S3 URI and boto3 is not installed. :raises FileNotFoundError: If *path* is a local path that does not exist. :raises ValueError: If *path* is an S3 URI with no object key (e.g. ``s3://bucket``).