extends attribute to fields to clarify if a field in a specified NXdata
is a AXISNAME
or DATA
#1533
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
NXdata
contains two renameable fields,AXISNAME
andDATA
, that are both of typeNX_NUMBER
. This naturally presents a problem in that any instance of any of the two must be properly allocated to either of the two concepts.On the data level, this is not a problem since this can be handled by properly assigning the
@signal
and@axes
attributes and thus it is immediately clear which data field belongs to which concept (see here).The problem is however not solved on the conceptual, data modelling level, i.e., when writing base classes and application definitions. Consider the following situation (borrowed directly from contributed_definitions/NXiv_temp):
Here, we as humans know which field in
/NXiv_temp/NXentry/NXdata
is associated with which field inNXdata
. However, there is no way for any interpretation tool to automatically understand this. Note that currently the way that each conceptual field is assigned toAXISNAME
orDATA
is by doing namefitting, i.e., by comparing whether the name of the field more closely resembles "axisname" or "data". For this particular example, this would lead to an assignment (on the conceptual level) of/NXiv_temp/NXentry/NXdata/temperature
toDATA
, i.e.temperature
would be specializingNXdata/DATA
. See the pop-up link on the bottom of this screenshot, here we actually visualize which concepttemperature
is inheriting from.During file writing with actual data, we will assign
temperature
toAXISNAME
by adding it to theaxes
. However, any proper data management system will complain here because what we define on the conceptual level will not be the same as what the data provider will injest.So what I think is needed is a way to already define on the data modelling level which field is an axis and which one is a data field.
As a fix, we add an extra attribute
extends
tofieldType
where one can explicitly say which field in the inheritance shall be extended. The language is specifically chosen to indicate that this is only possible for the use case outlined above and not for any arbitrary case (to prevent people from just extending any arbitrary field defined somewhere else).