Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Yigit Gunsur Elmacioglu <[email protected]>
  • Loading branch information
f0uriest and YigitElma authored Dec 13, 2024
1 parent e100920 commit ff1bda6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/test_objective_funs.py
Original file line number Diff line number Diff line change
Expand Up @@ -1428,15 +1428,15 @@ def test_signed_plasma_vessel_distance(self):
def test_mirror_ratio_equilibrium(self):
"""Test mirror ratio objective for Equilibrium."""
# axisymmetry, no iota, so B ~ B0/R
eq = Equilibrium()
eq = Equilibrium(L=8, M=8)
eq.solve()
# R0 = 10, a=1, so Bmax = B0/9, Bmin = B0/11
mirror_ratio = (1 / 9 - 1 / 11) / (1 / 9 + 1 / 11)
obj = MirrorRatio(eq)
obj.build()
f = obj.compute(eq.params_dict)
# not perfect agreement bc eq is low res, so B isnt exactly B0/R
np.testing.assert_allclose(f, mirror_ratio, rtol=0.13)
np.testing.assert_allclose(f, mirror_ratio, rtol=3e-3)

@pytest.mark.unit
def test_mirror_ratio_omni_field(self):
Expand Down

0 comments on commit ff1bda6

Please sign in to comment.