Skip to content

fix KDSource visualization - #2692

Merged
willend merged 2 commits into
mccode-dev:mainfrom
jorobledo:kdsource_view
Sep 25, 2026
Merged

willend merged 2 commits into
mccode-dev:mainfrom
jorobledo:kdsource_view

Conversation

@jorobledo

Copy link
Copy Markdown
Contributor

Trace in McStas was not really possible because we could not subsample the set of ray counts. This PR just allows to NOT overwrite the ncount when we do trace, and then just trace the number passed in -n. Allows for KDS component visualization in mcdisplay.


Declaration of use of AI-tools

  • Please add a checkmark here if you used AI-tools during the work for this contribution
  • Furter, please describe how / where and for what the tools were used:

Nope


Development OS / boundary conditions

Tested on Mac


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

    • [ x ] I have used the mcdoc utility and rendered a reasonable documentation page for the component (please attach as screenshot in comments!)
    • [ x ] I have ensured that basic use of the component is OK (e.g. an instrument using it compiles?)
    • [ x ] I have used the mctest utility to test one or more instruments making use of the component (please attach mcviewtest report as screenshot in comments)
Compiling instruments [seconds]...
Test_KDSource :   1.48

Running tests / getting status...
Test_KDSource  :   Display OK (1s)
Test_KDSource  :   0.87    [val: 3996.61 / 4056.0 = 99 %]
 - Test 1 plots generated OK
Test_KDSource_2:   0.75    [val: 4002.57 / 4056.0 = 99 %]
 - Test 2 plots generated OK
Test_KDSource_3:   3.06    [val: 4005.7 / 4056.0 = 99 %]
 - Test 3 plots generated OK
Test_KDSource_4:  26.21    [val: 4002.88 / 4056.0 = 99 %]
 - Test 4 plots generated OK
======================================
Overall test result:
SUCCESS
  • [ ] I have used the mccode-clangformat tool to apply the standard McCode component indentation scheme
  • I have used the mcrun --c-lint "linter" and followed advice to remove most / all warnings that are raised

@willend

willend commented Sep 25, 2026

Copy link
Copy Markdown
Contributor

@jorobledo great, just like we discussed. Maybe we should in fact do the same fix for MCPL_input*.comp

@jorobledo

Copy link
Copy Markdown
Contributor Author

tests for the MCPL_input* components fix.

Compiling instruments [seconds]...
Test_MCPL_input      :   3.51
Test_MCPL_input_once :   3.14

Running tests / getting status...
Test_MCPL_input       :   Display OK (2s)
Test_MCPL_input       :   1.07    [val: 227516000000.0 / 242284000000.0 = 94 %]
 - Test 1 plots generated OK
Test_MCPL_input_2     :   1.16    [val: 227516000000.0 / 242284000000.0 = 94 %]
 - Test 2 plots generated OK
Test_MCPL_input_once  :   Display OK (1s)
Test_MCPL_input_once  :   1.04    [val: 227516000000.0 / 242284000000.0 = 94 %]
 - Test 1 plots generated OK
Test_MCPL_input_once_2:   1.05    [val: 227516000000.0 / 242284000000.0 = 94 %]
 - Test 2 plots generated OK
======================================
Overall test result:
SUCCESS

@willend
willend merged commit a98695a into mccode-dev:main Sep 25, 2026
13 checks passed
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.

2 participants