Skip to content

Commit

Permalink
update coil test to use average change
Browse files Browse the repository at this point in the history
  • Loading branch information
YigitElma committed Nov 25, 2024
1 parent 1e036cf commit 3c3dadc
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/test_optimizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -1356,7 +1356,6 @@ def test_quad_flux_with_surface_current_field():
)


@pytest.mark.skip
@pytest.mark.unit
def test_optimize_coil_currents(DummyCoilSet):
"""Tests optimization takes step sizes proportional to variable scales."""
Expand All @@ -1377,8 +1376,9 @@ def test_optimize_coil_currents(DummyCoilSet):
verbose=2,
copy=True,
)
# check that optimized coil currents changed by more than 15% from initial values
# check that on average optimized coil currents changed by more than
# 15% from initial values
np.testing.assert_array_less(
np.asarray(coils.current) * 0.15,
np.abs(np.asarray(coils_opt.current) - np.asarray(coils.current)),
np.mean(np.asarray(coils.current) * 0.15),
np.mean(np.abs(np.asarray(coils_opt.current) - np.asarray(coils.current))),
)

0 comments on commit 3c3dadc

Please sign in to comment.