Add NXstress smoke-test demo script#5
Draft
Copilot wants to merge 4 commits into
Draft
Conversation
Please run `pixi run build-dev-docs` and then see:
`docs/_build/developer/design/nexus/IO_prototype.html`
(built from: `docs/developer/source/design/nexus/IO_prototype.rst`).
for more information, see https://pre-commit.ci
…s/scripts/cis_tests' directory
…s imports Agent-Logs-Url: https://github.com/ekapadi/PyRS/sessions/ca15213f-1a65-4144-913c-9e7579014108 Co-authored-by: ekapadi <5505178+ekapadi@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
ekapadi
May 1, 2026 10:31
View session
b4a2257 to
4cab5d9
Compare
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.
Summary
Implements the "by hand" smoke-test script requested in the issue, demonstrating the full feature set of the new NXstress I/O implementation.
Changes
New file:
tests/scripts/cis_tests/NXstress_demo_script.pyA standalone script (ignored by pytest per the directory's
README.rst) that walks through:Load – opens
tests/data/3393_PWHT-TD.h5into aHidraWorkspaceviaHidraProjectFile.Fit – calls
generate_PeakCollection_from_workspace(fromtests/util/peak_collection_helpers.py) with afit_dicwhosepeak_labelvalues follow thepeak_tagconvention required byNXstress._parse_peak_tag:"Fe 311"for the first peak (2θ range 87.6 – 91.6°, d₀ = 1.08 Å)"Fe 222"for the second peak (2θ range 93.5 – 95.9°, d₀ = 1.03 Å)These labels match the
hklPhaselog stored in the data file (b'Fe 311, Fe 222').Write – writes the workspace and fitted
list[PeakCollection]toNXstress_demo_output.nxsusingNXstressas a context manager.Read back – re-opens the NXstress file and performs a brief round-trip consistency check (sub-run count and peak-collection count).
Modified file:
tests/util/peak_collection_helpers.pyAdded the two imports that
generate_PeakCollection_from_workspacealready uses but were missing from the module:Usage
Requires a full PyRS environment (mantid, scipy, nexusformat, etc.). Output NXstress file is written to the current working directory as
NXstress_demo_output.nxs.