Repository navigation
Conversation
A McStas NeXus scan writes one NXentry per step (entry1, entry2, ...) into one mccode.h5; McStasToX always read entry1. Data(), i.e. Read(), and McStasNeXus now take entry="entry1" (default unchanged) and use it for validation, the component list, the McStas version and component lookup. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
A McStas NeXus scan writes one NXentry per step (
entry1,entry2, …) into a singlemccode.h5. McStasToX always readentry1, so only the first scan step was accessible.Read()/Data()andMcStasNeXusnow take anentryargument. It defaults to"entry1", so existing behaviour is unchanged:entryis used for file validation, the component list, the McStas version, and component lookup (every former hardcoded"entry1").Motivation
mcplot-plopp (McCode) shows McStasToX event data and will loop over scan entries, stacking events per scan step. Related McCode fix: mccode-dev/McCode#2901, which makes MPI NeXus scans keep every step's events. Before it, only the last entry of an MPI scan was readable.
Testing
tests/entry_test.py:_validate_fileacceptsentry2and reports a missing entry by name.r, a non-MPI one and a 4-rank MPI one with the McCode fix), every entry loads throughexport_scipp. Event counts match the non-zero-weight events read directly with h5py.entry_test.pyandmcstas_config_test.pywere run locally; the other tests need McStas/mcstasscript, so CI will cover those.🤖 Generated with Claude Code