Open willend opened 1 month ago
A number of existing instruments may include SPLIT
on the first element of a GROUP
- so I am currently aiming for a fatal error in case of any later SPLIT
, i.e.
FATAL ERROR:
Component PG002_ana_up1_1_1_2=Monochromator_curved() at line BAMBUS.instr:1057 is in GROUP analyzers and has a SPLIT.
Only the first component of a GROUP may impose SPLIT, so please only include
SPLIT on PG002_ana_up1_1_1_1 (first in GROUP) or better yet to an earlier component!
1st GROUP
comp, raise a warning / recommendation:
INFO: No output directory specified (--dir)
INFO: Using directory: "BAMBUS_20240527_145301"
INFO: Regenerating c-file: BAMBUS.c
Info: 'Al_window' is a contributed component.
Warning: Component PG002_ana_up1_1_1_1=Monochromator_curved() at line BAMBUS.instr:1052 is 1st in GROUP analyzers and has a SPLIT.
Best practice is to move the SPLIT to an earlier component.
--> Added COMPONENT PG002_mono USERVAR ncol_23 with type int
Exit in case of SPLIT
on later GROUP
comp:
INFO: No output directory specified (--dir)
INFO: Using directory: "BAMBUS_20240527_145534"
INFO: Regenerating c-file: BAMBUS.c
Info: 'Al_window' is a contributed component.
Warning: Component PG002_ana_up1_1_1_1=Monochromator_curved() at line BAMBUS.instr:1052 is 1st in GROUP analyzers and has a SPLIT.
Best practice is to move the SPLIT to an earlier component.
FATAL ERROR:
Component PG002_ana_up1_1_1_2=Monochromator_curved() at line BAMBUS.instr:1057 is in GROUP analyzers and has a SPLIT.
Only the first component of a GROUP may impose SPLIT, so please only include
SPLIT on PG002_ana_up1_1_1_1 (first in GROUP) or better yet to an earlier component!
Prompted by @g5t I just had a look at the NICOS virtual McStas models available at git clone https://forge.frm2.tum.de/review/mlz/mcstas/nicos-instruments
One of these (
panda_bambus
) has 501 (!!)Monochromator_curved
in aGROUP
that each have aSPLIT 20
:grep SPLIT BAMBUS.instr | grep PG | wc -l
In targeted v. 2.7.2 this is (inadvertently?) handled by a single
SPLIT
on theGROUP
it seems:... Whereas we in McStas-3.x get the start of building logic for 500
SPLIT
S - each with a Warning:Perhaps we should make that Warning a proper error instead...