-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fairmat 2024: add target attribute to NXdata #1410
base: main
Are you sure you want to change the base?
Conversation
519a48a
to
ba4f869
Compare
base_classes/NXdata.nxdl.xml
Outdated
If the data corresponds to a readout of a detector, ``@reference`` links | ||
to that detectors data: | ||
|
||
@reference: '/entry/instrument/detector/data' for a 2D detector |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can remove "2D"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed, I changed it
This is fine for a path in the same file, but what if the NXdata and the referenced data field are not in the same file? Edit: the target attribute of a link also doesn't refer to external files, so I guess this is not worse. |
base_classes/NXdata.nxdl.xml
Outdated
<doc> | ||
Points to the path of a field defining the data to which the `DATA` group refers. | ||
|
||
This concept allows to link the data to a respective field in the NeXus hierarchy, thereby |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggest rewording to avoid using the word "link":
"This attribute indicates the origin of the data, thereby providing an association to further metadata that define the physical quantity that the data represents"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
implemented
Compare with the existing `target` attribute. This is used with NeXus links.
…On Sun, Sep 29, 2024, 9:51 AM Ben Watts ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In base_classes/NXdata.nxdl.xml
<#1410 (comment)>
:
> @@ -309,6 +309,20 @@
</doc>
</attribute>
+ <attribute name="reference">
+ <doc>
+ Points to the path of a field defining the data to which the `DATA` group refers.
+
+ This concept allows to link the data to a respective field in the NeXus hierarchy, thereby
suggest rewording to avoid using the word "link":
"This attribute indicates the origin of the data, thereby providing an
association to further metadata that define the physical quantity that the
data represents"
—
Reply to this email directly, view it on GitHub
<#1410 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AARMUMC3CDQPQWOKY2UC46LZZAHXPAVCNFSM6AAAAABOWGTX46VHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDGMZVHA3TGMJUGA>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
The NIAC asks if it's possible to use the target attribute instead of adding a new attribute |
I didn't see why it could not be used. But the content and structure must
remain unchanged.
…On Sun, Sep 29, 2024, 10:14 AM Aaron S. Brewster ***@***.***> wrote:
The NIAC asks if it's possible to use the target attribute instead of
adding a new attribute reference. This could affect the target
documentation because in the past it's only been used for links, but here
it's desired to use the target attribute without links. This could also
affect nexusformat API.
—
Reply to this email directly, view it on GitHub
<#1410 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AARMUMECYCYWOQRLKMMCXLLZZAKMPAVCNFSM6AAAAABOWGTX46VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGOBRGM4TIMRQGM>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
85ea386
to
903ffbe
Compare
I think this PR is premature. I believe that at the recent NIAC, we agreed to look into whether the same thing could be achieved with the |
As a quick follow-up to my last comment, I see that the proposal has now been changed to use 'target' instead of 'reference'. I still think this needs some further discussion, because this is a major structural change to the format. Personally, I believe that the PR should be resubmitted, with a detailed introduction explaining the rationale for all these changes and what the consequences are. I don't believe it's good practice to submit a PR with absolutely no explanation because it makes it impossible for future readers to know the context of the request and it makes it very difficult for current reviewers to understand what is proposed and why. I know we discussed it in the NIAC but I didn't really understand why it was needed then and I understand it less now. For example, the current docstrings say the target "attribute indicates the origin of the data, thereby providing an association to further metadata that define the physical quantity that the data represents." What does "origin" mean here if the data is not actually linked? Can the field with the In the following, the soft link is created before the target object. The
Does that accomplish what you need? It's true that, if you use h5py instead of the nexusformat API, you might want to manually add the The point of this discussion is that you can probably achieve what you need without a major structural change to the format, but we need to know the precise use case you have in mind to know how. I am willing to amend the nexusformat API to facilitate your use case. |
@rayosborn thanks for the pointers in the nexusformat API. This idea is not really about the order when links are created, but also for cases where not necessarily a link in HDf5 is created, but one would still like to say where the data originated from. I outlined multiple usage above, hope that helps to clarify the purpose of this new attribute. I/we would be happy to further discuss this. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When these changes are done, ok to move to online vote, as discussed by NIAC meeting Dec 18 2024
base_classes/NXdata.nxdl.xml
Outdated
If the data corresponds to a readout of a detector, ``@target`` points | ||
to that detectors data: | ||
|
||
@target: '/entry/instrument/detector/data' for a detector |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo: detectors --> detector's
Also, use a different example that doesn't use detector twice.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The point here is to say: an NXdata
group somewhere (i.e., not on the detector) is actually originating from the NXdata
group that is part of the NXdetector
. I changed this now to
Example:
If the root-level ``NXdata`` corresponds to a readout of a specific detector called "my_detector", ``@target`` points
to the ``NXdata`` group of the `NXdetector` group describing that detector:
@target: '/entry/instrument/my_detector/data'
Would that be helpful @phyy-nx? I think the problem also occurs with any other example.
base_classes/NXdata.nxdl.xml
Outdated
@@ -309,6 +309,20 @@ | |||
|
|||
</doc> | |||
</attribute> | |||
<attribute name="target"> | |||
<doc> | |||
Points to the path of a field defining the data to which the `DATA` group refers. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
field --> group
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changed
1618cc8
to
42877b3
Compare
# Conflicts: # base_classes/nyaml/NXdata.yaml
# Conflicts: # base_classes/NXsource.nxdl.xml # base_classes/nyaml/NXdata.yaml # base_classes/nyaml/NXsource.yaml # contributed_definitions/NXactuator.nxdl.xml # contributed_definitions/NXcalibration.nxdl.xml # contributed_definitions/NXelectronanalyser.nxdl.xml # contributed_definitions/NXresolution.nxdl.xml # contributed_definitions/nyaml/NXactuator.yaml # contributed_definitions/nyaml/NXcalibration.yaml # contributed_definitions/nyaml/NXelectronanalyser.yaml # contributed_definitions/nyaml/NXresolution.yaml
# Conflicts: # base_classes/nyaml/NXdata.yaml # contributed_definitions/NXactuator.nxdl.xml # contributed_definitions/NXdata_mpes.nxdl.xml # contributed_definitions/NXdata_mpes_detector.nxdl.xml # contributed_definitions/NXelectronanalyser.nxdl.xml # contributed_definitions/NXresolution.nxdl.xml # contributed_definitions/nyaml/NXactuator.yaml # contributed_definitions/nyaml/NXdata_mpes.yaml # contributed_definitions/nyaml/NXdata_mpes_detector.yaml # contributed_definitions/nyaml/NXelectronanalyser.yaml # contributed_definitions/nyaml/NXresolution.yaml
bb2b020
to
2c1c6cd
Compare
This PR introduces a new concept for
NXdata
. Essentially, the idea is here that a new attribute is added toNXdata
to indicate the origin of the data. The whole idea comes from discussion with instrument manufacturers who would like to combine multiple detector readings into the top-level NXdata group (e.g., for spin-resolved photoemission measurements) and would like to keep track for both them and the user where this data originated.In the case of a link, the value of this attribute would be the target of the link. That is, if an
NXdata
group inentry/data
is linked from anNXdata
group on the detector, the value of this attribute would be ´entry/dectector/detector_data. Similarly, both for the ´AXISNAME
andDATA
fields, such an attribute is added to indicate directly where this axis/data field is originating from.This new attribute serves multiple purposes:
nxlink
, attribute it is easy to resolve to the linked object (however, it is less easy using h5py or any other HDF5 library). In any case, also with the nexusformat API, this resolving however works only if e.g. theNXdata
and the referenced data group are in the same file (as far as I understand, please correct me if I'm wrong). With the target attribute, there is at least the option to keep track from where this data originally came from, even if the link is not directly resolvable anymore.NXdata/AXISNAME
. With a link, that would be impossible because in HDF5, the two concepts would then refer to the same object. Thus, one would rather like to make a copy the field values, but still indicate with this new attribute where the data was originally from.Please note that this attribute was originally called
@reference
, with the idea of referring back to other data. It was changed to@target
upon request by the NIAC in the NIAC meeting 2024, but in my opinion, these concepts are slightly different and a different name would fit that attribute better.