RTL validation not being ran when using symbolic references
This was fixed partially in !359 (merged)
Two cases still remain:
Setting r, t or l as a symbol reference and sweeping the symbol
import finesse
from finesse.analysis.actions import Xaxis, Printer
model = finesse.Model()
model.parse(
"""\
var X 0.5
m m1 R=0.5 T=X L=0.0
"""
)
model.run(
Xaxis(
model.X,
"lin",
0,
1,
2,
post_step=Printer("R=", model.m1.R, "T=", model.m1.T, "L=", model.m1.L),
)
)
R= 0.5 T= 0.0 L= 0.0
R= 0.5 T= 0.5 L= 0.0
R= 0.5 T= 1.0 L= 0.0
setting r, t, or l as a symbol and simply changing value
import finesse
model = finesse.Model()
model.parse("""
var X 0.5
m m1 R=0.5 T=X L=0
"""
)
model.X = 0.9 #does not trigger exception
model.X = 5 # does not trigger exception
model.run() # does not trigger exception, but will hit https://gitlab.com/ifosim/finesse/finesse3/-/blob/develop/src/finesse/components/modal/mirror.pyx#L221 and modify the values
## Proposed solution
- always verify all RTL's for all surfaces on any parameter update
- build a tree of symbolic references (may already exist?) and call the validators of the parameters that refer to a symbol when its value is changed (recursively?)
- just trigger an exception in the cython matrix filling code before r and t are being filled