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: Mapping[str, str | int | float | Mapping[str, JSON_ITEM] | Sequence[JSON_ITEM] | None] | 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: Mapping[str, str | int | float | Mapping[str, JSON_ITEM] | Sequence[JSON_ITEM] | None] | None = None, specs: List[Spec] | None = None, **kwargs: Any | None) None[source]
Methods
__class_getitem__Parameterizes a generic class.
__contains__(key)__delattr__(name, /)Implement delattr(self, name).
__dir__(/)Default dir() implementation.
__eq__(other)Return self==value.
__format__(format_spec, /)Default object formatter.
__ge__(value, /)Return self>=value.
__getattribute__(name, /)Return getattr(self, name).
__getitem__(key)__getstate__(/)Helper for pickle.
__gt__(value, /)Return self>value.
__init__(tree, *data_uris[, dataset, ...])__init_subclass__Function to initialize subclasses.
__iter__()Iterate over the keys of the tree
__le__(value, /)Return self<=value.
__len__()__lt__(value, /)Return self<value.
__ne__(value, /)Return self!=value.
__new__(*args, **kwargs)__reduce__(/)Helper for pickle.
__reduce_ex__(protocol, /)Helper for pickle.
__repr__()Return repr(self).
__setattr__(name, value, /)Implement setattr(self, name, value).
__sizeof__(/)Size of object in memory, in bytes.
__str__(/)Return str(self).
__subclasshook__(C)Abstract classes can override this to customize issubclass().
_items_slice(start, stop, direction[, page_size])_keys_slice(start, stop, direction[, page_size])from_catalog(data_source, node, /[, ...])from_uris(*data_uris[, dataset, swmr, ...])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()supported_storage()values()Attributes
__abstractmethods____annotations____dict____doc____hash____module____orig_bases____parameters____reversed____slots____weakref__list of weak references to the object
_abc_implitems_indexerkeys_indexerspecsstructure_familyvalues_indexerfn