scippnexus.File#
- class scippnexus.File(name, *args, definitions=DefaultDefinitions, **kwargs)[source]#
- __init__(name, *args, definitions=DefaultDefinitions, **kwargs)[source]#
Context manager for NeXus files, similar to h5py.File.
Arguments other than documented are as in
h5py.File.- Parameters:
name (
str|PathLike[str] |BytesIO|Group) – Specifies the file to open. If this is ahyp5.Fileobject, the :class:`File will wrap this file handle but will not close it when used as a context manager.definitions (
Mapping[str,type] |DefaultDefinitionsType, default:DefaultDefinitions) – Mapping of NX_class names to application-specific definitions. The default is to use the base definitions as defined in the NeXus standard.
Methods
__init__(name, *args[, definitions])Context manager for NeXus files, similar to h5py.File.
close()create_class(name, class_name)Create empty HDF5 group with given name and set the NX_class attribute.
create_field(key, value)Create a child dataset with given name and value.
get(k[,d])items()Return a view of pairs of the keys and the group's elements.
keys()Return a view of the keys of the group's elements.
values()Return a view of the group's elements.
Attributes
attrsThe attributes of the group.
definitionsdimsfilenamenx_classThe value of the NX_class attribute of the group.
parentshapesizesunderlyingunit