Commit 6d03e1b7 authored by Daniel Brown's avatar Daniel Brown
Browse files

more reference testing for detectors

parent e22a9bc4
......@@ -8,7 +8,6 @@ from copy import deepcopy
kat0 = pykat.finesse.kat()
kat0.parseCommands("m m1 1 0 0 n0 n1")
kat0.parseCommands("pd o0 n1")
kat0.parseCommands("pd1 o1 1 0 n1")
kat1 = deepcopy(kat0)
......@@ -23,6 +22,29 @@ assert(kat0.m1.n0 != kat1.m1.n0)
assert(kat0.m1.n0.node != kat1.m1.n0.node)
assert(kat0.nodes.n0 != kat1.nodes.n0)
assert(kat0.o1 != kat1.o1)
assert(kat0.o1.__class__ != kat1.o1.__class__)
# use is to compare if two params are the same object as equals is override to compare the value
assert(kat0.o1.f1 is not kat1.o1.f1)
assert(kat0.o1.f1 == kat1.o1.f1)
kat0.o1.f1 *= 2
kat0.o1.phi1 *= 2
assert(isinstance(kat0.o1.f1, pykat.param.Param))
assert(isinstance(kat0.o1.phi1, pykat.param.Param))
assert(kat0.o1.f1 != kat1.o1.f1)
kat1.o1.num_demods = 2
assert(hasattr(kat1.o1, "f2"))
assert(not hasattr(kat0.o1, "f2"))
kat1.num_demods = 1
assert(hasattr(kat1.o1, "f1"))
new = kat1.nodes.createNode("n4")
kat1.nodes.replaceNode(kat1.m1, kat1.m1.n0, new)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment