open_h5_resource

function of dascore.utils.hdf5 source

open_h5_resource(
    resource ,
    mode: str ,
    constructor ,
    open_kwargs_getter ,
)-> ’_ManagedH5pyFile’

Open an HDF5 resource and return DASCore’s managed h5py handle wrapper.

This is the central constructor for h5py-backed reads in DASCore. It keeps the branching needed for local paths, already-open handles, remote fileobj-backed reads, cached-local reuse, and no-range HTTP fallback in one place so H5Reader.get_handle() stays thin.

Parameters

Parameter Description
resource A local path, remote UPath, open file object, or existing h5py
handle.
mode The mode to pass to the h5py constructor.
constructor The callable used to construct an h5py handle.
open_kwargs_getter Callback which returns backend-specific kwargs for remote file opens.