Skip to content
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: small additions to NXsource #1407

Merged
merged 20 commits into from
Dec 10, 2024

Conversation

lukaspie
Copy link
Contributor

@lukaspie lukaspie commented Sep 23, 2024

This PR makes some changes to NXsource, mostly to expand the range of where it can be used and to what detail the source can be described:

  • class docstring: indicate that NXsource is for any kind of radiation source, not just for neutron or x-ray storage ring/facilities
  • add new items to enum types: LED, Laser, etc. with the possibility to specify type_other through an attribute on type
    • this is a direct follow-up to the docstring change indicated above
  • add new item to enum for probe: photon
    • this is for experiments where e.g. the X-ray energy is scanned across a wide range, such that it is neither just x-ray or ultraviolet. Think survey scans in XPS as an example.
  • add new unnamed groups: NXaperture, NXdeflector, NXlens_em (see discussion below), NXfabrication
  • add new fields: wavelength, pulse_energy, peak_power, anode_material, filament_current, emission_current, gas_pressure,
    previous_source
    • these are additional parameters that can be measured on different source types during operation (see discussion below)
    • previous source: this is to be used if multiple sources are placed right after another to describe for a secondary source the instance(s) of NXsource from which a beam originated to reach this source.

@lukaspie lukaspie force-pushed the fairmat-2024-nxsource branch from 72bf9cb to d09e6cc Compare September 23, 2024 14:48
@sanbrock sanbrock mentioned this pull request Sep 26, 2024
@lukaspie lukaspie linked an issue Sep 29, 2024 that may be closed by this pull request
@phyy-nx
Copy link
Contributor

phyy-nx commented Sep 30, 2024

Proposal: accept changes with additions requested. Cannot merge until NXlens_em is reviewed.

Accepted by vote in NIAC2024

domna and others added 18 commits October 16, 2024 10:33
… version of yaml.

Removing unintensional comments

# Conflicts:
#	base_classes/NXbeam.nxdl.xml
#	base_classes/NXdetector.nxdl.xml
#	base_classes/NXentry.nxdl.xml
#	base_classes/NXinstrument.nxdl.xml
#	base_classes/NXprocess.nxdl.xml
#	base_classes/NXsample.nxdl.xml
#	base_classes/NXsource.nxdl.xml
#	contributed_definitions/NXcollectioncolumn.nxdl.xml
#	contributed_definitions/NXmpes.nxdl.xml
# Conflicts:
#	base_classes/NXdetector.nxdl.xml
#	base_classes/NXinstrument.nxdl.xml
#	base_classes/NXsensor.nxdl.xml
#	base_classes/nyaml/NXdetector.yaml
#	base_classes/nyaml/NXinstrument.yaml
#	base_classes/nyaml/NXsensor.yaml
#	base_classes/nyaml/NXsource.yaml
# Conflicts:
#	base_classes/NXroot.nxdl.xml
#	contributed_definitions/NXmpes.nxdl.xml
# Conflicts:
#	base_classes/NXdata.nxdl.xml
#	base_classes/nyaml/NXdata.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
#	contributed_definitions/nyaml/NXsource.yaml
# Conflicts:
#	base_classes/nyaml/NXsource.yaml
# Conflicts:
#	base_classes/nyaml/NXsource.yaml
# Conflicts:
#	base_classes/nyaml/NXsource.yaml
# Conflicts:
#	base_classes/nyaml/NXsource.yaml
# Conflicts:
#	base_classes/nyaml/NXsource.yaml
#	contributed_definitions/NXdeflector.nxdl.xml
#	contributed_definitions/nyaml/NXdeflector.yaml
# Conflicts:
#	base_classes/nyaml/NXsource.yaml
#	contributed_definitions/NXdeflector.nxdl.xml
#	contributed_definitions/nyaml/NXdeflector.yaml
…ersion

# Conflicts:
#	applications/NXarpes.nxdl.xml
#	applications/nyaml/NXarpes.yaml
#	base_classes/NXaperture.nxdl.xml
#	base_classes/NXbeam.nxdl.xml
#	base_classes/NXdata.nxdl.xml
#	base_classes/NXdetector.nxdl.xml
#	base_classes/NXentry.nxdl.xml
#	base_classes/NXenvironment.nxdl.xml
#	base_classes/NXinstrument.nxdl.xml
#	base_classes/NXmonochromator.nxdl.xml
#	base_classes/NXroot.nxdl.xml
#	base_classes/NXsample.nxdl.xml
#	base_classes/NXsample_component.nxdl.xml
#	base_classes/NXsensor.nxdl.xml
#	base_classes/NXsubentry.nxdl.xml
#	base_classes/NXtransformations.nxdl.xml
#	base_classes/NXuser.nxdl.xml
#	base_classes/nyaml/NXaperture.yaml
#	base_classes/nyaml/NXbeam.yaml
#	base_classes/nyaml/NXdata.yaml
#	base_classes/nyaml/NXentry.yaml
#	base_classes/nyaml/NXenvironment.yaml
#	base_classes/nyaml/NXmonochromator.yaml
#	base_classes/nyaml/NXprocess.yaml
#	base_classes/nyaml/NXroot.yaml
#	base_classes/nyaml/NXsample.yaml
#	base_classes/nyaml/NXsample_component.yaml
#	base_classes/nyaml/NXsensor.yaml
#	base_classes/nyaml/NXsource.yaml
#	base_classes/nyaml/NXsubentry.yaml
#	base_classes/nyaml/NXtransformations.yaml
#	base_classes/nyaml/NXuser.yaml
#	contributed_definitions/nyaml/NXdetector.yaml
#	contributed_definitions/nyaml/NXinstrument.yaml
Co-authored-by: Aaron S. Brewster <[email protected]>
@lukaspie lukaspie force-pushed the fairmat-2024-nxsource branch from 96ffad8 to de3cbe5 Compare October 16, 2024 08:33
@lukaspie lukaspie added the NIAC vote needed PR needs an approving vote from NIAC before merge label Oct 17, 2024
@phyy-nx
Copy link
Contributor

phyy-nx commented Dec 6, 2024

@sanbrock @lukaspie the above comment says 'Cannot merge until NXlens_em is reviewed.'. What PR was that referring to?

Also there is an unresolved comment about moving some of this to subclasses.

Also, please add a description to the top of this PR. Thanks!

@lukaspie
Copy link
Contributor Author

lukaspie commented Dec 6, 2024

@sanbrock @lukaspie the above comment says 'Cannot merge until NXlens_em is reviewed.'. What PR was that referring to?

In NXsource, we are now making use of NXlens_em, which so far has been living in contributed_definitions. In order for this to be standardized, during the NIAC meeting the suggestion was that we move it to base_classes, because an officially accepted base class should not depend on a contributed one. However, this can also be done in a separate PR if you agree.

Note that in our current implementation, NXlens_em is inheriting from the much broader NXcomponent. It would probably be helpful to discuss whether this is a good idea and, if so, NXcomponent should also be standardized.

Also there is an unresolved comment about moving some of this to subclasses.

Here, I am a bit stumped as to what the idea was. I discussed it a bit above in the comment itself.

Also, please add a description to the top of this PR. Thanks!

Done.

@phyy-nx
Copy link
Contributor

phyy-nx commented Dec 9, 2024

Comments from Telco:

  • Remove type_other and Other from the type enumeration
  • Create a new PR that adds to enumeration an attribute open=False, which would allow the enumeration to allow values not in the list. Note that accepting that change would require adapting sphinx to render it nicely, and affect validators. They should not produce errors but could produce a warning. That PR would need a NIAC vote.
  • Don't go with subclasses for wavelength, gas_pressure, etc. Not technically what we voted on, but the Telco agrees that we'd have to do mixed inheritance which isn't technically possible given our new inheritance model.
  • Remove NXlens_em. When NXlens_em is approved to move out of contributed definitions, in the same PR that implements that, NXlens_em can be re-added to NXsource

Once the above is done, a simple review and merge can be done. No vote needed.

@phyy-nx
Copy link
Contributor

phyy-nx commented Dec 10, 2024

Whoops, this one didn't need a vote. Comment deleted

@phyy-nx phyy-nx merged commit 54e0735 into nexusformat:main Dec 10, 2024
2 checks passed
@phyy-nx phyy-nx mentioned this pull request Dec 10, 2024
2 tasks
@lukaspie lukaspie deleted the fairmat-2024-nxsource branch December 11, 2024 08:07
@lukaspie
Copy link
Contributor Author

Thanks @phyy-nx for resolving and merging!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NIAC vote needed PR needs an approving vote from NIAC before merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

additions to NXsource
4 participants