PaNOSC-ViNYL / McStasScript

McStas API for creating and running McStas instruments from python scripting
BSD 3-Clause "New" or "Revised" License
9 stars 11 forks source link

Group skipped in reader #39

Open nicriz opened 2 years ago

nicriz commented 2 years ago

Hi I just realized that after having read a pre-existing instrument with reader.McStas_file the original file and the one generated by McStasScript gave different results. I found that the issue was due to one line skipped by the Reader.

Original:

  COMPONENT slab = Arm()
  AT (0, 0, apothem1-0.0005) RELATIVE target
  Group Cadmium
  EXTEND %{
  SCATTER; 
  hithole=0;//...otherwise 0
  %}

become:

  COMPONENT slab = Arm()
  AT (0, 0, apothem1-0.0005) RELATIVE target
  EXTEND %{
  SCATTER;
  hithole=0;
  %}

By substituting Group Cadmium with GROUP Cadmium the conversion happens smoothly. Probably the parser should be allowed to read non Capital command? The original is correctly executed by McStas after all.

I run the code with McStas 2.7 and the last release of McStasScript. Hope this help.

u-eff-gee commented 2 years ago

Did 9e768dc676e4a5b437c59ec7afb1198f77f91312 solve this issue?

mads-bertelsen commented 1 year ago

That commit should solve the issue, but I don't believe this release has been pushed to pip yet, there will be a new version shortly.