Repository navigation
Open
Description
Problem
NXroot is the only base class that does not extend NXobject. This is on purpose: NXobject declares items the root must not have:
- NeXus groups:
NXcollection,NXdata,NXlog,NXnote,NXparameters,GROUPNAME_log; - NeXus fields:
FIELDNAME_set,FIELDNAME_errors,FIELDNAME_weights,FIELDNAME_mask,identifierNAME.
But NXobject is also where NeXus declares what applies to every NeXus group and field (#1668, #1669). Since NXroot does not extend it, none of that reaches NXroot:
@NX_classis declared twice: required inNXobjectand again inNXroot.@defaultis declared twice: once inNXobjectand once inNXroot, each with its own documentation.- The
fieldAttributesofNXobject(@target,@units,@long_name, …) are copied intoNXroot; a test keeps both copies the same. - Anything added to
NXobjectfor every NeXus group and field later on has to be copied toNXrootby hand, or the root silently misses it.
Proposal
Add a new base class (name to be decided, e.g. NXnode) that holds only what applies to every NeXus group and field, the root included:
- NeXus attributes of every NeXus group:
@NX_class(required,valueFrom="class"),@default; fieldAttributes:@target,@units,@long_name, …
Then:
NXobjectextends it, adds the NeXus groups and fields listed above, and adds@targetfor groups;NXrootextends it and adds the NeXus attributes of the root (file_name,file_time,NeXus_release, …).
Each shared item is then declared once, and NXroot picks up future additions automatically.
@target for groups stays in NXobject: the root cannot be a content link.
Questions for the NIAC
- The name of the new class.
- Should
@defaultmove to the common class, keeping theNXrootdocumentation (which says it points to anNXentry) as a refinement? - Does any tool assume that
NXobjectis the top of every inheritance chain, or thatNXroothas noextends?
Related
- Express attributes of any field or group in XSD, applied to XML, not HDF5 #1668, Define NeXus attributes of all fields and groups, and make content links independent of storage #1669: attributes of all fields and groups in
NXobject - add
targetattribute toNXobjectusing new field super-type #1558:@targetinNXobject
Metadata
Metadata
Assignees
Labels
No labels
Activity