-
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
add depends_on and related to all component type classes #897
Conversation
…ave a depends_on field and NXtransformations group. Done until NXinsertion_device in the base class list.
base_classes/NXattenuator.nxdl.xml
Outdated
</doc> | ||
</field> | ||
|
||
<group name="transformations" type="NXtransformations" minOccurs="0"> |
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.
Is this name fixed?
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.
I thought it is a good idea to have that in the same place in each group. Is there a use case for another name?
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 name is not important from a parsing perspective because you are always following a depends_on
path to find it anyway. I also can't think of a use case for allowing a different name though.
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.
@prjemian Can you chime in on this? From session G of CodeCamp2021, we are split on this issue. Whether to specify the name as transformations or leave it optional. (Note, nobody had a really strong opinion :)
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.
IMO, not sure why it is necessary to require the exact name. Within the BES Bluesky communitym there is a group looking at XPCS data and has begun learning how to apply NX transformations. They have assumed the name is not required to be exactly transformations
. Thus, in any NXDL spec, the name could be omitted unless there are two or more NXtransformations groups in the same directory. In such case, they need names to avoid ambiguity.
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.
For the crystallography community, prescriptive naming is not likely to work.
On the matter of deprecating distance in favor of deriving it from the axis chain, that also is not likely to work, since distance, wavelength and beam center are essential data for
processing. The best we are likely to be able t do is to make it clear when they are derived versus when they are directly observed and make derived the default.
the instrument. | ||
</doc> | ||
</group> | ||
<group type="NXoff_geometry" minOccurs="0"> |
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.
Or "NXcylindrical_geometry"
* transformation_type | ||
* depends_on | ||
|
||
as needed. |
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.
Was it agreed by NIAC to prefer using these names? I sometimes use the name of a motion axis device for example.
Should we also explicitly mention that an NXlog
can be used in place of a dataset?
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.
? These are the standard transformation related attribute types.
At the beginning of the code camp we discussed this issue and decided to move all the older NeXus
positioning fields into NXtransformations. The use case you describe, an axis name called hugo with a very weird operation, is still possible.
The NXlog is a good point and I see where I can fit this in.
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.
Sorry, by "these names" I meant "distance", "height", etc.
<doc> | ||
NeXus positions components by applying a set of translations and rotations | ||
to apply to the component starting from 0, 0, 0. The order of these operations | ||
is critical and form a what NeXus calls a dependency chain. The depends_on |
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.
Should read "and forms what NeXus..."
<dimensions rank="1"> | ||
<dim index="1" value="3" /> | ||
</dimensions> | ||
<enumeration> |
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.
This attribute is defined as having a number type thus can probably cannot be an enumeration.
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.
That's not quite right: arrays are not allowed as enumeration items.
@@ -176,6 +192,207 @@ | |||
differences. Use of ``AXISNAME_end`` is recommended. | |||
</doc> | |||
</field> | |||
<field name="distance" type="NX_FLOAT" units="NX_LENGTH" minOccurs="0"> |
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.
This fixes the coordinate frame's z axis direction. I think the frame should be left as a choice for beamlines/facilities.
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.
See comments on prescriptive naming and keeping explicit distance, beam center and wavelength, and note that the enumeration issue still needs to be resolved, but all that being said, it really is time to make use of NXtranformations the norm.
I believe that what @mkoennecke has done is to add depends_on and NXtransformations where they were missing, which I'm quite pleased about. However, as discussed in one of the code camp sessions, going further and deprecating distance and beam center fields is likely not necessary. I've reverted the deprectations and replaced them with comments here: Further, while I was working on this, I see that @mkoennecke added the deprecated fields explicitly to NXtransformations as example names for beamline components. For example, compare this removal of distance to where it was added as an example axis name to NXtransformations. I think the additions to NXtransformations aren't needed in formal NXdl language. I'd instead like to see examples as text, such as what @yayahjb and I are hoping to do when resolving #412. That would make it more clear that axis names and conventions aren't proscriptive. But as that's more work, I'd instead propose reverting most of the changes to NXtransformations as the next step in this PR. Would love to hear any feedback though. Thanks! |
Aaron is right -- Herbert
…On Mon, Mar 29, 2021 at 5:53 PM Aaron S. Brewster ***@***.***> wrote:
I believe that what @mkoennecke <https://github.com/mkoennecke> has done
is to add depends_on and NXtransformations where they were missing, which
I'm quite pleased about. However, as discussed in one of the code camp
sessions, going further and deprecating distance and beam center fields is
likely not necessary. I've reverted the deprectations and replaced them
with comments here:
issue-681...issue-681-aaron
<issue-681...issue-681-aaron>
Further, while I was working on this, I see that @mkoennecke
<https://github.com/mkoennecke> added the deprecated fields explicitly to
NXtransformations as example names for beamline components. For example,
compare this removal of distance
<https://github.com/nexusformat/definitions/pull/897/files#diff-958495767f26dd709fe7d1ab478f93f1183a252690722aeed15013b7b9f4ec81R46>
to where it was added as an example axis name
<https://github.com/nexusformat/definitions/pull/897/files#diff-d5885ae955bdaadaf3e76bec7bfc38ffa4225cb3072708adaeee02116912726bR197>
to NXtransformations.
I think the additions to NXtransformations aren't needed in formal NXdl
language. I'd instead like to see examples as text, such as what @yayahjb
<https://github.com/yayahjb> and I are hoping to do when resolving #412
<#412>. That would make
it more clear that axis names and conventions aren't proscriptive. But as
that's more work, I'd instead propose reverting most of the changes to
NXtransformations as the next step in this PR. Would love to hear any
feedback though.
Thanks!
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#897 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABB6EAPOIQASYHBAIL2XCALTGDZFXANCNFSM4ZU3CGUQ>
.
|
Hmmh, IMHO we should not give up to quickly on names for transformations. I am in favor to keep them at least as suggestions. Some of them are very old names, with NeXus since its inception. These are things like distance, rotation_angle, polar_angle, height and such. Then there are names which never got popular like azimuthal_angle, meridional_angle. May be drop those. We not only have to cater for the anarchic MX community but also for people who are relatively new to NeXus and would prefer a little hand holding when choosing a name for say: a translation in x or y. |
The comment by @mkoennecke about deprecating |
As far as I know, there is no tutorial but there is documentation in addition to what is provided by the NXtransformation base class. The manual has a section with one example. More examples would be very useful. |
I think Aaron is right that we should put most of this aside for the moment
and talk it through slowly and carefully.
…On Tue, Mar 30, 2021 at 10:40 AM Ray Osborn ***@***.***> wrote:
The comment by @mkoennecke <https://github.com/mkoennecke> about
deprecating polar_angle, etc, alarmed me. Are people actually suggesting
deprecating distance, polar_angle, azimuthal_angle, etc, in favor of
abstract depends_on chains? I hope not because we use them all the time.
Personally, I have never used transformations and I think it would be a
mistake to force everyone to use them. It is another non-intuitive aspect
of the standard for people to learn, and I don't think we even provide a
tutorial (please point me to one if I'm wrong). If I have got the wrong end
of the stick, please ignore this comment.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#897 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABB6EANHBBOWB242PRJGRP3TGHPFPANCNFSM4ZU3CGUQ>
.
|
I have updated this pull request by merging in aaron's changes which remove most of the deprecated messages and merged with main. Please review again. |
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.
An apparent duplicate PR exists (#999 (comment)). Please consider which if these two pull requests to pursue and close the other with a suitable comment.
Fixes #681, This is the first version of adding NXtransformations, depends_on and NXoff_geometry to all base classes needing them.