pninexus.h5cpp

pninexus.io.h5cpp is a thin wrapper around the h5cpp C++ library where every namespace in the C++ library has a counterpart as a sub-package of pninexus.io.h5cpp

class pninexus.h5cpp.Path

This class represents an HDF5 path. A path in HDF5 is a list of link names which should be followed starting from a particular node to access another node. A path is absolute if the first node should be the root group of a particular file. In its string representation a absolute path can be identified by a leading `/.

There are two passiblities how to construct a path:

  • either use the default constructor

    path = Path()
    
  • or construct from a string representation

    path = Path("sensors/temperature/data")
    
absolute

Read-write property either set a path to absolute or to check whether a path is absolute.

from pninexus import h5cpp

path = h5cpp.Path("/run_001/sensors/temperature")
print(path)
#output: /run_0001/sensors/temperature

print(path.absolute) #this should print True

path.absolute = False
print(path)
#output: run_0001/sensors/temperature
name

Read-only property returning the last element of a path (basically the name of the last link in the chain)

Return type:

str

parent

Read-only property returning a path except for the last last element

path = h5cpp.Path("/run_0001/sensors/temperature")
print(path.parent)
#output: /run_0001/sensors
size

Read-only property returning the number of elements (link names) in this path.

Return type:

int

append(name)

Append a an additional name to the end of the path

Parameters:

name (str) – the link name to add

__add__(other)

Paths can be concatenated using the + operator.

p1 = Path("/run_0001")
p2 = Path("sensors/temperature/data")
print(p1+p2)
#output: /run_0001/sensors/temperature/data
__eq__(other)

Return self==value.

Paths can be checked for equality. Two paths are considered equal if they store the same link names in the same order.

class pninexus.h5cpp.IteratorConfig

Class providing configuration information for link, node and attribute iteration.

index

read-write property to set and retrieve the index to use for the iteration.

Parameters:

index (IterationIndex) – index to use for iteration

Return type:

IterationIndex

order

read-write property to set and retrieve the iteration order

Parameters:

order (IterationOrder) – order value

Return type:

IterationOrder

read-write attribute to set and retrieve the link access property list which should be used for iteration.

Parameters:

lapl (h5cpp.property.LinkAccessList) – link access property list

Return type:

pninexus.h5cpp.property.LinkAccessList

class pninexus.h5cpp.IterationOrder

Enumeration type determining in which order a particular iteration index should be traversed.

NATIVE platform and/or library depending native order
DECREASING traverse the index in decreasing order
INCREASING traverse the index in increasing order
class pninexus.h5cpp.IterationIndex

Enumeration type determining which index to use for iteration over the node tree.

NAME use the link name of a node as an iteration index
CREATION_ORDER use the order of creation as a node index