Repository navigation
mctest: say that -n on a %Test/%Example line is ignored - #2820
Merged
Merged
Conversation
A %Test/%Example always runs at the global --ncount (scaled by --statfactor). Only %Scan/%TestScan uses its own -n. This has always been the case: before split_test_line, the line's -n was passed to mcrun ahead of the global -n, which won. About 40 shipped %Example lines carry a -n (1e3 to 1e8) that has never been used, which misled test authors. - log one line per %Test/%Example whose -n is ignored - comment and mctest.md now say -n is scan-only and point to the instrument (e.g. SPLIT) for better test statistics No change to how tests run or to their results. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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
mctest only uses the
-non%Scan/%TestScanlines. A%Test/%Examplealways runs at the global--ncount(scaled by--statfactor). This was never stated anywhere, and about 40 shipped%Examplelines carry a-nthat has never been used (1e8in FRMII_SPODI,1e7/1e5/1e4/1e3elsewhere, in both McStas and McXtrace). This came up while fixing templateSANS_Mantid's reference for #2808.History: the
-nhas always been ignored. Beforesplit_test_line(e5e7b58), the line's-nwas passed to mcrun ahead of the global-n, and mcrun (optparse) keeps the last value given, so the global one won.Changes
mctest.py: log one line for each%Test/%Examplewhose-nis ignored, and add a comment at the ncount selection.mctest.md: say that-non a%Test:line is only a hint for users (mcdoc shows it) and is ignored, and that better test statistics come from changing the instrument (e.g.SPLIT).No change to which ncount tests run at or to their results. The
-ntokens in the instruments are left as they are, since they serve as advice for users.Honouring
-ninstead was considered and rejected. It would run FRMII_SPODI 100 times longer (very likely a timeout), run several instruments 10 times longer, and run the 1e3–1e5 tests with 10 to 1000 times fewer rays than their 1e6 targets were made with.Testing
py_compilepasses.%Examplelines with-n, and not for scans.🤖 Generated with Claude Code