ad detector without (correct) node
The code:
from finesse import Model
code = """
laser l1 P=1
s s1 l1.p1 bs1.p1
bs bs1 R=0.5 T=0.5
ad ad1 1 bs1.p1 0 0
"""
model = Model()
model.parse(code)
The error:
KatDirectiveCompilationError: (use finesse.tb() to see the full traceback)
line 5: Expected argument 'node' to be None or of type Node but got argument of type <class 'int'>
4: bs bs1 R=0.5 T=0.5
-->5: ad ad1 1 bs1.p1 0 0
^^
or
from finesse import Model
code = """
laser l1 P=1
s s1 l1.p1 bs1.p1
bs bs1 R=0.5 T=0.5
ad ad1 1 1 bs1.p1 0 0
"""
model = Model()
model.parse(code)
with error
KatDirectiveCompilationError: (use finesse.tb() to see the full traceback)
line 5: 'ad' takes from 4 to 6 positional arguments but 7 were given
4: bs bs1 R=0.5 T=0.5
-->5: ad ad1 1 1 bs1.p1 0 0
It would be good to highlight the line rather than just 'as' and give the extpected syntax.