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 a hyp5.File object, 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()

keys()

values()

Attributes

attrs

The attributes of the group.

dims

file

name

nx_class

The value of the NX_class attribute of the group.

parent

shape

sizes

unit