Module H5O¶
Module for HDF5 “H5O
” functions.
Functional API¶
-
h5py.h5o.
open
(ObjectID loc, STRING name, PropID lapl=None) → ObjectID¶ Open a group, dataset, or named datatype attached to an existing group.
-
h5py.h5o.
link
(ObjectID obj, GroupID loc, STRING name, PropID lcpl=None, PropID lapl=None)¶ Create a new hard link to an object. Useful for objects created with h5g.create_anon() or h5d.create_anon().
-
h5py.h5o.
copy
(ObjectID src_loc, STRING src_name, GroupID dst_loc, STRING dst_name, PropID copypl=None, PropID lcpl=None)¶ Copy a group, dataset or named datatype from one location to another. The source and destination need not be in the same file.
The default behavior is a recursive copy of the object and all objects below it. This behavior is modified via the “copypl” property list.
-
h5py.h5o.
set_comment
(ObjectID loc, STRING comment, **kwds)¶ Set the comment for any-file resident object. Keywords:
- STRING obj_name (“.”)
Set comment on this group member instead
- PropID lapl (None)
Link access property list
-
h5py.h5o.
get_comment
(ObjectID loc, STRING comment, **kwds)¶ Get the comment for any-file resident object. Keywords:
- STRING obj_name (“.”)
Set comment on this group member instead
- PropID lapl (None)
Link access property list
-
h5py.h5o.
visit
(ObjectID loc, CALLABLE func, **kwds) → <Return value from func>¶ Iterate a function or callable object over all objects below the specified one. Your callable should conform to the signature:
func(STRING name) => Result
or if the keyword argument “info” is True:
func(STRING name, ObjInfo info) => Result
Returning None continues iteration; returning anything else aborts iteration and returns that value. Keywords:
- BOOL info (False)
Callback is func(STRING, Objinfo)
- STRING obj_name (“.”)
Visit a subgroup of “loc” instead
- PropLAID lapl (None)
Control how “obj_name” is interpreted
- INT idx_type (
h5.INDEX_NAME
) What indexing strategy to use
- INT order (
h5.ITER_INC
) Order in which iteration occurs
Compatibility note: No callback is executed for the starting path (“.”), as some versions of HDF5 don’t correctly handle a return value for this case. This differs from the behavior of the native H5Ovisit, which provides a literal “.” as the first value.
-
h5py.h5o.
get_info
(ObjectID loc, STRING name=, INT index=, **kwds) → ObjInfo¶ Get information describing an object in an HDF5 file. Provide the object itself, or the containing group and exactly one of “name” or “index”.
- STRING obj_name (“.”)
When “index” is specified, look in this subgroup instead. Otherwise ignored.
- PropID lapl (None)
Link access property list
INT index_type (
h5.INDEX_NAME
)INT order (
h5.ITER_INC
)
Module constants¶
Copy flags¶
-
h5py.h5o.
COPY_SHALLOW_HIERARCHY_FLAG
¶ Copy only immediate members of a group.
-
h5py.h5o.
COPY_EXPAND_SOFT_LINK_FLAG
¶ Expand soft links into new objects.
-
h5py.h5o.
COPY_EXPAND_EXT_LINK_FLAG
¶ Expand external link into new objects.
-
h5py.h5o.
COPY_EXPAND_REFERENCE_FLAG
¶ Copy objects that are pointed to by references.
-
h5py.h5o.
COPY_WITHOUT_ATTR_FLAG
¶ Copy object without copying attributes.