icecube / pisa

Monte Carlo-based data analysis
http://icecube.github.io/pisa/
Apache License 2.0
19 stars 47 forks source link

Fix small parameter scaling issues #688

Closed atrettin closed 2 years ago

atrettin commented 2 years ago

In some special pathological cases, rounding errors can cause a rescaled value to end up outside the bounds of a parameter. In this case, we want to clip the value back to the edge of the range.

Another small issue is that some functions rely on the fact that range[0] is the smaller value and range[1] is the larger value. Because this is a thing that many users might rely on elsewhere, we can avoid hard-to-catch numerical errors by enforcing that order in the setter method of the range.

philippeller commented 2 years ago

Thanks for this PR, it looks good to me - will merge!