Open kjwoodsISIS opened 4 years ago
Given this implies a possible floating point generated summation of the index, it would be wise to build in a "near equality" test of loop indices into the generated code, this avoids unexpected behaviour in the FP accuracy of a summed index by checking for near equality within a very small delta (rather than exact floating point equality). i.e.
for (x = start; neareq(x, end); x += step-size)
Note: that the user is NOT programming in python here, so good programming "hygiene" is the script generator's responsibility entirely, and should avoid unexpected surprises the user might not intend, like a missing iteration from "for 1.0 to 30.0 in step 1"
giving too few steps.
(The alternative is to dynamically expand the loop index into separate steps in the interface where the error would then be obvious.)
Should include squish tests
Not sure how this is different from defining parameters for start
, end
and step
in your script definition.
Muon scientists say it would be great however to be able to see the list of inbetween steps as a tooltip.
As scientist using the Script Generator, I want to specify iterations as start, stop and step-size, because it is a more convenient way to define iterations with many steps.
Acceptance Criteria
Notes
for
loop in most programming languages (e.g.for (x = start; x < end; x += step-size)
).start = 0.3K
,end = 4.6K
,step-size = 0.2K
. We need to be clear to users how this will be translated into Python code. In the above example, will the iteration finish at 4.5K or 4.7K? It is merely a matter of choosing a convention and documenting it.