Skip to content

Commit f89a054

Browse files
committed
fix tests and test get of weights
1 parent a807778 commit f89a054

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

tests/test_tuning_orbit_correction.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,8 @@ def test_tuning_orbit_correction():
133133

134134
positions_ac = bpms.positions.get()
135135
std_ac = np.std(positions_ac, axis=0)
136-
assert np.isclose(std_ac[0], 5.0567271717464e-07, rtol=0, atol=1e-14)
137-
assert np.isclose(std_ac[1], 4.78926715640338e-07, rtol=0, atol=1e-14)
136+
assert np.isclose(std_ac[0], 5.056719006414065e-07, rtol=0, atol=1e-14)
137+
assert np.isclose(std_ac[1], 4.790610352466602e-07, rtol=0, atol=1e-14)
138138
element_holder.orbit.set_weight("BPM_C04-05", 1)
139139

140140
# mangle orbit again, test virtual weight
@@ -208,6 +208,15 @@ def test_tuning_orbit_correction():
208208
assert np.isclose(frf, frf_after, rtol=0, atol=1e-16)
209209
element_holder.orbit.set_rf_weight(rf_weight)
210210

211+
# test getters of weights
212+
assert np.isclose(
213+
element_holder.orbit.get_weight("BPM_C04-05", plane="H"), 1, rtol=0, atol=1e-16
214+
)
215+
assert np.isclose(element_holder.orbit.get_virtual_weight(), 1, rtol=0, atol=1e-16)
216+
assert np.isclose(
217+
element_holder.orbit.get_rf_weight(), rf_weight, rtol=0, atol=1e-16
218+
)
219+
211220

212221
def test_tuning_orbit_correction_config():
213222
# test orbit config

0 commit comments

Comments
 (0)