@@ -13,9 +13,17 @@ def test_single():
1313 mcoil = MultiCoil (1.1 , 0.2 , current = 100.0 , mirror = False )
1414 coil = MultiCoil (1.1 , 0.2 , current = 100.0 )
1515
16- assert np .isclose (coil .controlPsi (0.3 , 0.1 ), mcoil .controlPsi (0.3 , 0.1 ))
16+ # run the test twice: once on the original coil and once on a copy
17+ # to check both produce the same results
18+ for _ in range (2 ):
19+ assert np .isclose (
20+ coil .controlPsi (0.3 , 0.1 ), mcoil .controlPsi (0.3 , 0.1 )
21+ )
1722
18- assert np .isclose (coil .controlBr (0.3 , 0.1 ), mcoil .controlBr (0.3 , 0.1 ))
23+ assert np .isclose (coil .controlBr (0.3 , 0.1 ), mcoil .controlBr (0.3 , 0.1 ))
24+
25+ mcoil = mcoil .copy ()
26+ coil = coil .copy ()
1927
2028
2129def test_two_turns ():
@@ -52,11 +60,23 @@ def test_mirrored():
5260 ]
5361 )
5462
55- assert np .isclose (circuit .controlPsi (0.3 , 0.1 ), mcoil .controlPsi (0.3 , 0.1 ))
63+ # run the test twice: once on the original coil and once on a copy
64+ # to check both produce the same results
65+ for _ in range (2 ):
66+ assert np .isclose (
67+ circuit .controlPsi (0.3 , 0.1 ), mcoil .controlPsi (0.3 , 0.1 )
68+ )
5669
57- assert np .isclose (circuit .controlBr (0.3 , 0.1 ), mcoil .controlBr (0.3 , 0.1 ))
70+ assert np .isclose (
71+ circuit .controlBr (0.3 , 0.1 ), mcoil .controlBr (0.3 , 0.1 )
72+ )
5873
59- assert np .isclose (circuit .controlBz (0.3 , 0.1 ), mcoil .controlBz (0.3 , 0.1 ))
74+ assert np .isclose (
75+ circuit .controlBz (0.3 , 0.1 ), mcoil .controlBz (0.3 , 0.1 )
76+ )
77+
78+ mcoil = mcoil .copy ()
79+ circuit = circuit .copy ()
6080
6181
6282def test_move_R ():
0 commit comments