H5Node
class¶
-
class
H5Node
(h5py_item=None)[source]¶ Bases:
object
Adapter over an h5py object to provide missing informations from h5py nodes, like internal node path and filename (which are not provided by
h5py
for soft and external links).It also provides an abstraction to reach node type for mimicked h5py objects.
-
h5py_object
¶ Returns the internal h5py node.
Return type: h5py.File or h5py.Group or h5py.Dataset
-
ntype
¶ Returns the node type, as an h5py class.
Return type: h5py.File
,h5py.Group
orh5py.Dataset
-
basename
¶ Returns the basename of this h5py node. It is the last identifier of the path.
Return type: str
-
is_broken
¶ Returns true if the node is a broken link.
Return type: bool
-
local_name
¶ Returns the path from the master file root to this node.
For links, this path is not equal to the h5py one.
Return type: str
-
local_file
¶ Returns the master file in which is this node.
For path containing external links, this file is not equal to the h5py one.
Return type: h5py.File Raises: RuntimeException – If no file are found
-
local_filename
¶ Returns the filename from the master file of this node.
For path containing external links, this path is not equal to the filename provided by h5py.
Return type: str Raises: RuntimeException – If no file are found
-
local_basename
¶ Returns the basename from the master file root to this node.
For path containing links, this basename can be different than the basename provided by h5py.
Return type: str
-
physical_file
¶ Returns the physical file in which is this node.
New in version 0.6.
Return type: h5py.File Raises: RuntimeError – If no file are found
-
physical_name
¶ Returns the path from the location this h5py node is physically stored.
For broken links, this filename can be different from the filename provided by h5py.
Return type: str
-
physical_filename
¶ Returns the filename from the location this h5py node is physically stored.
For broken links, this filename can be different from the filename provided by h5py.
Return type: str
-
physical_basename
¶ Returns the basename from the location this h5py node is physically stored.
For broken links, this basename can be different from the basename provided by h5py.
Return type: str
-
data_url
¶ Returns a
silx.io.url.DataUrl
object identify this node in the file system.Return type: DataUrl
-
url
¶ Returns an URL object identifying this node in the file system.
This URL can be used in different ways.
# Parsing the URL import silx.io.url dataurl = silx.io.url.DataUrl(item.url) # dataurl provides access to URL fields # Open a numpy array import silx.io dataset = silx.io.get_data(item.url) # Open an hdf5 object (URL targetting a file or a group) import silx.io with silx.io.open(item.url) as h5: ...your stuff...
Return type: str
-