Skip to content

Conversation

@jl-wynen
Copy link
Member

This adds support for writing some metadata models to NeXus files via ScippNexus' __write_to_nexus_group__ hook. Inspired by scipp/essnmx#187 and scipp/scippnexus#289

I stuck with standard NeXus fields and attributes and didn't add support anything beyond that. I also didn't implement this for Measurement and Beamline because they are not written to their own isolated group but are mixed with a bunch of other fields. And I am unsure how that would be used in practice.

@jl-wynen jl-wynen requested a review from YooSunYoung January 22, 2026 13:44
_create_optional_nexus_field(group, 'address', self.address)
_create_optional_nexus_field(group, 'affiliation', self.affiliation)
_create_optional_nexus_field(group, 'email', self.email)
_create_optional_nexus_field(group, 'name', self.name)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is name optional?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is in nexus but not in scippneutron. Changed

_create_optional_nexus_field(group, 'address', self.address)
_create_optional_nexus_field(group, 'affiliation', self.affiliation)
_create_optional_nexus_field(group, 'email', self.email)
_create_optional_nexus_field(group, 'name', self.name)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like it's not optional based on the tests and reader.

Suggested change
_create_optional_nexus_field(group, 'name', self.name)
snx.create_field(group, 'name', self.name)

@jl-wynen jl-wynen enabled auto-merge January 22, 2026 14:22
@jl-wynen jl-wynen merged commit 1de8a33 into main Jan 22, 2026
9 of 10 checks passed
@jl-wynen jl-wynen deleted the metadata-nexus-out branch January 22, 2026 14:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants