Add nowritefile parameter to all Union loggers and abs_loggers - #2607
Add nowritefile parameter to all Union loggers and abs_loggers#2607mads-bertelsen-agentic wants to merge 15 commits into
Conversation
The nowritefile parameter, already standard for monitors, skips writing output data to disk when set. This adds the same feature to all Union logger and abs_logger components: a new int nowritefile=0 setting parameter, a documentation line under %P, and the save section wrapped in an if (!nowritefile) statement. Union_abs_logger_nD already had the parameter and inherits the if-statement from Monitor_nD through SAVE INHERIT; its documentation line was corrected from 'Not functional for Union version'.
0c63f0b to
2b989e1
Compare
|
Hi @mads-bertelsen-agentic, @mads-bertelsen The Windows test is failing - very likely due to a too long path / filename. I've dug out just the relevant portion of the test output in the attached zip-file for convenience The failing instruments all seem to error in compilation with this type of output: Part of the issue comes from a requirement to make output folders unique (including details on platform and execution conditions) - and while I can correct / solve part of the problem by adjusting (I suggest stylistic changes along the lines of e.g. |
|
Rebased PR branch to current state of main @mads-bertelsen-agentic @mads-bertelsen |
|
@mads-bertelsen-agentic, @mads-bertelsen there is in fact a good chance the rebase will let the tests to run through - I'd still like the stylistic filename changes.. |
|
Great catch! Didn’t think of that long filename issue even though I have encountered it on windows systems before. Happy to shorten the names of the test instruments, changing the component names themselves would require updating a lot of instruments, in repo and outside, so hope it’s acceptable to leave those as they are. |
|
@mads-bertelsen another complexity occurred - testing multiple comps with similar names easily leads to folder-clashes in the CI - but have nailed it now I think... |
sync to McXtrace

Free-form text area
Please describe what your PR is adding in terms of features or bugfixes:
The nowritefile parameter, already standard for monitors, skips writing output data to disk when set. This adds the same feature to all Union logger and abs_logger components: a new int nowritefile=0 setting parameter, a documentation line under %P, and the save section wrapped in an if (!nowritefile) statement.
Union_abs_logger_nD already had the parameter and inherits the if-statement from Monitor_nD through SAVE INHERIT; its documentation line was corrected from 'Not functional for Union version'.
Declaration of use of AI-tools
Development OS / boundary conditions
Please describe what OS you developed and tested your additions on, and if any special dependencies are required:
UTM Virtual machine OS X 14.6.1 (23G93)
PR Checklist for contributing to McStas/McXtrace
For a coherent and useful contribution to McStas/McXtrace, please fill in relevant parts of the checklist:
My contribution includes patches to an existing component file
mcdocutility and rendered a reasonable documentation page for the component (please attach as screenshot in comments!)mctestutility to test one or more instruments making use of the component (please attachmcviewtestreport as screenshot in comments)mccode-clangformattool to apply the standard McCode component indentation schememcrun --c-lint"linter" and followed advice to remove most / all warnings that are raisedMy contribution includes patches to an existing instrument file
mcdocutility and rendered a reasonable documentation page for the instrument (please attach as screenshot in comments!)mctestutility to test the instrument (please attachmcviewtestreport as screenshot in comments)mcrun --c-lint"linter" and followed advice to remove most / all warnings that are raisedMy contribution includes a new component file
mcdocutility and rendered a reasonable documentation page for the component (please attach as screenshot in comments!)mccode-clangformattool to apply the standard McCode component indentation schemecontribcomponent categoryMy contribution includes a new instrument file
mcdocutility and rendered a reasonable documentation page for the instrument (please attach as screenshot in comments!)%Example:line to describe expected behaviourmcrun --c-lint"linter" and followed advice to remove most / all warnings that are raisedexampleshierarchy in a folder in the style ofexamples/ESS/New_stuff/New_stuff.instrexamplefolder, but if general use I have placed it in the globaldatafolder.My work touches the code-generator in mccode/src
My work touches / adds to the runtime lib code (.c,.h etc in multiple locations
My PR is meant to fix a specific, existing issue
My contribution contains something else