Skip to content

Commit

Permalink
Fix: Update test suite to support comparison of eqdsk "comment" key
Browse files Browse the repository at this point in the history
  • Loading branch information
bryan-garcia committed Dec 13, 2023
1 parent 3242455 commit 21aed73
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tests/component/test_efit.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,10 @@ def test_load_geqdsk(data_dir):
#
# Check keys and values of loaded SNL eqdsk are consistent
#
explicit_comparisons = ['comment'] # Keys to use "==" operator with
for baseline_k, test_k in zip(sorted(baseline), sorted(session.geqdsk_data)):
assert baseline_k == test_k, "Key mismatch in loaded data."
k = baseline_k
assert np.allclose(baseline[k], session.geqdsk_data[k]), "Numerics mismatch in data."
compare = lambda x, y: x == y if k in explicit_comparisons else np.allclose
assert compare(baseline[k], session.geqdsk_data[k]), "Numerics mismatch in data."

0 comments on commit 21aed73

Please sign in to comment.