4
***********************
5
Reference Documentation
6
***********************
8
.. module:: h5py.highlevel
10
The high-level interface is the most convenient method to talk to HDF5. There
11
are three main abstractions: files, groups, and datasets. Each is documented
24
General information about h5py and HDF5
25
=======================================
30
HDF5 files are organized like a filesystem. :class:`Group` objects work like
31
directories; they can contain other groups, and :class:`Dataset` objects. Like
32
a POSIX filesystem, objects are specified by ``/``-separated names, with the
33
root group ``/`` (represented by the :class:`File` class) at the base.
35
Wherever a name or path is called for, it may be relative or absolute.
36
Unfortunately, the construct ``..`` (parent group) is not allowed.
41
As of version 1.2, h5py uses a "hybrid" exception system. When an error is
42
detected inside HDF5, an exception is raised which inherits from both a
43
standard Python exception (TypeError, ValueError, etc), and an HDF5-specific
44
exception class (a subclass of H5Error).
46
It's recommended that you use the standard Python exceptions in you code;
47
for example, when indexing a Group object:
50
>>> grp = mygroup[name]
52
>>> print 'Group "%s" does not exist' % name
57
A few library options are available to change the behavior of the library.
58
You can get a reference to the global library configuration object via the
59
function ``h5py.get_config()``. This object supports the following attributes:
62
Set to a 2-tuple of strings (real, imag) to control how complex numbers
63
are saved. The default is ('r','i').
66
Booleans are saved as HDF5 enums. Set this to a 2-tuple of strings
67
(false, true) to control the names used in the enum. The default
73
H5py is now always thread-safe. However, as HDF5 does not support thread-level
74
concurrency (and as it is not necessarily thread-safe), access to the library
75
is automatically serialized. The GIL is released around read/write operations
76
so that non-HDF5 threads (GUIs, computation) can continue to execute.