tiled.adapters.hdf5.HDF5Adapter
- class tiled.adapters.hdf5.HDF5Adapter(tree: dict[str, Any] | Sentinel, *data_uris: str, dataset: str | None = None, structure: ArrayStructure | None = None, metadata: Dict[str, str | int | float | bool | Dict[str, Dict[str, str | int | float | bool | Dict[str, JSON] | List[JSON]]] | List[Dict[str, str | int | float | bool | Dict[str, JSON] | List[JSON]]]] | None = None, specs: List[Spec] | None = None, **kwargs: Any | None)[source]
Adapter for HDF5 files
This map the structure of an HDF5 file onto a “Tree” of array structures.
- Parameters:
- treedict
A dictionary representing the HDF5 file or group. The keys are the names of the groups or datasets, and the values are either dictionaries (representing groups) or None (representing datasets). HDF5 datasets will be mapped to HDF5ArrayAdapter instances, and groups will be mapped to HDF5Adapter instances. The tree is rooted at the ‘dataset’ node.
- data_urisstr
The URI of the file, or a list of URIs if the dataset spans multiple files.
- datasetstr
The dataset to read, for example, “/path/to/dataset” within the file. If supplied, this path will effectively become the root of the adapter.
- metadatadict
Metadata for the adapter
- specslist
A list of specs for the adapter
- kwargsdict
Additional keyword arguments, such as swmr, libver, etc. – they are not stored as separate attributes
Examples
From the root node of a file given a filepath
>>> import h5py >>> HDF5Adapter.from_uri("file://localhost/path/to/file.h5")
- __init__(tree: dict[str, Any] | Sentinel, *data_uris: str, dataset: str | None = None, structure: ArrayStructure | None = None, metadata: Dict[str, str | int | float | bool | Dict[str, Dict[str, str | int | float | bool | Dict[str, JSON] | List[JSON]]] | List[Dict[str, str | int | float | bool | Dict[str, JSON] | List[JSON]]]] | None = None, specs: List[Spec] | None = None, **kwargs: Any | None) None [source]
Methods
__init__
(tree, *data_uris[, dataset, ...])from_catalog
(data_source, node, /[, ...])from_uris
(*data_uris[, dataset, swmr, libver])get
(key, *args)Overwrite to always raise KeyErrors for broken links and missing items
inlined_contents_enabled
(depth)items
()keys
()metadata
()read
([fields])search
(query)structure
()values
()Attributes
items_indexer
keys_indexer
structure_family
values_indexer
fn