hdf_pointer
BasePointer
Pointer to a location in an hdf5 file. The constructor takes a :class:`~.file_handler.FileHandler` and the in-file path to the object. The base class represents a generic group in the file
BasePointer (
file_handler: bamboost.common.file_handler.FileHandler,
path_to_data: str
)
- file_handler :
bamboost.common.file_handler.FileHandler
file this belongs to
- path_to_data :
<class 'str'>
infile path to object
- path_to_data :
- obj :
The object this BasePointer points to. File needs to be open for access.
- attrs :
new_pointer
new_pointer (
cls,
file_handler: bamboost.common.file_handler.FileHandler,
path_to_data: str
) -> bamboost.common.hdf_pointer.BasePointer
Returns a new pointer object.
- cls :
Any
- file_handler :
<class 'bamboost.common.file_handler.FileHandler'>
- path_to_data :
<class 'str'>
BasePointer[key]
__getitem__ (self, key)
None
- self :
Any
- key :
Any
<class 'inspect._empty'>
Group
Pointer to a location in an hdf5 file. The constructor takes a :class:`~.file_handler.FileHandler` and the in-file path to the object. The base class represents a generic group in the file
Group (
file_handler: bamboost.common.file_handler.FileHandler,
path_to_data: str
)
- file_handler :
bamboost.common.file_handler.FileHandler
file this belongs to
- path_to_data :
<class 'str'>
infile path to object
iter(Group)
__iter__ (self)
None
- self :
Any
<class 'inspect._empty'>
keys
keys (self) -> set
None
- self :
Any
<class 'set'>
groups
groups (self) -> set
None
- self :
Any
<class 'set'>
datasets
datasets (self) -> set
None
- self :
Any
<class 'set'>
MutableGroup
Used for the `userdata` group.
MutableGroup (
file_handler: bamboost.common.file_handler.FileHandler,
path_to_data: str
)
- file_handler :
bamboost.common.file_handler.FileHandler
- path_to_data :
<class 'str'>
MutableGroup[key]
__getitem__ (self, key) -> Any
Used to access datasets (:class:`~bamboost.common.hdf_pointer.Dataset`) or groups inside this group (:class:`~bamboost.common.hdf_pointer.MutableGroup`)
- self :
Any
- key :
Any
typing.Any
MutableGroup[key] = ...
__setitem__ (self, key, newvalue)
Used to set an attribute. Will be written as an attribute to the group.
- self :
Any
- key :
Any
- newvalue :
Any
<class 'inspect._empty'>
update_attrs
update_attrs (self, attrs: dict) -> None
Update the attributes of the group.
- self :
Any
- attrs :
<class 'dict'>
the dictionary to write as attributes
None
add_dataset
add_dataset (
self,
name: str,
vector: numpy.ndarray,
attrs: dict = None,
dtype: str = None
) -> None
Add a dataset to the group. Error is thrown if attempting to overwrite with different shape than before. If same shape, data is overwritten (this is inherited from h5py -> require_dataset)
- self :
Any
- name :
<class 'str'>
Name for the dataset
- vector :
<class 'numpy.ndarray'>
Data to write (max 2d)
- attrs :
<class 'dict'>
Optional. Attributes of dataset.
- dtype :
<class 'str'>
Optional. dtype of dataset. If not specified, uses dtype of inpyt array
None
require_group
require_group (self, name: str) -> bamboost.common.hdf_pointer.Group
Add a new group to the current group. If exists, return existing.
- self :
Any
- name :
<class 'str'>
Dataset
Pointer to a location in an hdf5 file. The constructor takes a :class:`~.file_handler.FileHandler` and the in-file path to the object. The base class represents a generic group in the file
Dataset (
file_handler: bamboost.common.file_handler.FileHandler,
path_to_data: str
)
- file_handler :
bamboost.common.file_handler.FileHandler
file this belongs to
- path_to_data :
<class 'str'>
infile path to object
- attrs :
- shape :
- dtype :
Dataset[key]
__getitem__ (self, slice)
None
- self :
Any
- slice :
Any
<class 'inspect._empty'>