Examples

The repository of the tool contains small example projects, in example_repos/, which are tested in its CI (see Development):

  • ExInstrBasic: classic .instr files, with a main instrument and two modes (FOO and BAR).

  • ExInstrIncludes: classic .instr files using shared C code from includes/ and an entire instrument pulled in from snippets/ via %include.

  • ExPyGenerated: McStasScript files generated with generatepy (i.e. mcstas-pygen) from the main instrument of ExInstrBasic, with a main instrument and one mode (SomeMode).

  • ExPyHelpers: a small hand-written McStasScript instrument (source, guide and monitors), with a main instrument and one mode (Long) built from code shared in the helper modules common.py, geometry.py and monitors.py. It also shows how to add %Example tests with other parameter values than the defaults.

  • ExInstrLocalFiles: classic .instr file using a project-specific component (localcomps/ExCountMonitor.comp, with its own C library) and an NCrystal material file (localdata/ExAlLike.ncmat).

  • ExPyLocalFiles: the same instrument, as hand-written McStasScript code.

  • ExPyExtra: a small hand-written McStasScript instrument, with an analysis package and a script in extra/, and tests in extra_pytests/ which use both (one of them runs a short simulation).