Low-level interface to the “H5S” family of data-space functions.
Create a new HDF5 dataspace object, of the given class. Legal values are SCALAR and SIMPLE.
Create a simple (slab) dataspace from a tuple of dimensions. Every element of dims_tpl must be a positive integer.
You can optionally specify the maximum dataspace size. The special value UNLIMITED, as an element of max_dims, indicates an unlimited dimension.
Unserialize a dataspace. Bear in mind you can also use the native Python pickling machinery to do this.
Bases: h5py._objects.ObjectID
Represents a dataspace identifier.
Properties:
Can be pickled if HDF5 1.8 is available.
Create a new copy of this dataspace.
Serialize a dataspace, including its selection. Bear in mind you can also use the native Python pickling machinery to do this.
Replace this dataspace’s extent with another’s, changing its typecode if necessary.
Determine the bounding box which exactly contains the current selection.
Determine the number of elements selected in point-selection mode.
Get a list of all selected elements. Return is a Numpy array of unsigned ints, with shape (<npoints>, <space rank).
Get the current hyperslab selection. The returned array has shape:
(<npoints>, 2, <rank>)
and can be interpreted as a nested sequence:
[ (corner_coordinate_1, opposite_coordinate_1), ... ]
with length equal to the total number of blocks.
Get the number of hyperslab blocks currently selected.
Determine the total number of points currently selected. Works for all selection techniques.
Determine selection type. Return values are:
Determine the shape of a “simple” (slab) dataspace. If “maxdims” is True, retrieve the maximum dataspace size instead.
Determine the rank of a “simple” (slab) dataspace.
Determine the total number of elements in a dataspace.
Determine if an existing dataspace is “simple” (including scalar dataspaces). Currently all HDF5 dataspaces are simple.
Set the offset of a dataspace. The length of the given tuple must match the rank of the dataspace. If None is provided (default), the offsets on all axes will be set to 0.
Select all points in the dataspace.
Select elements by specifying coordinates points. The argument “coords” may be an ndarray or any nested sequence which can be converted to an array of uints with the shape:
(<npoints>, <space rank>)
Examples:
>>> obj.shape
(10, 10)
>>> obj.select_elements([(1,2), (3,4), (5,9)])
A zero-length selection (i.e. shape (0, <rank>)) is not allowed by the HDF5 library.
Select a block region from an existing dataspace. See the HDF5 documentation for the meaning of the “block” and “op” keywords.
Deselect entire dataspace.
Determine if the current selection falls within the dataspace extent.
Reset the dataspace extent via a tuple of dimensions. Every element of dims_tpl must be a positive integer.
You can optionally specify the maximum dataspace size. The special value UNLIMITED, as an element of max_dims, indicates an unlimited dimension.
Numpy-style shape tuple representing dimensions. () == scalar.
Accepted in place of an actual datapace; means “every point”
Indicates an unlimited maximum dimension