Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
james-packer committed Dec 13, 2024
1 parent efa515f commit b3ecc74
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions tests/test_graphs.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,24 @@ def test_get_magnetic_3d_graph(mc):
assert almost_equal(graph_result.data[1][1], y)


def test_get_magnetic_graph_harmonics(mc):
reset_to_default_file(mc)

mc.set_variable("TorqueCalculation", True)
mc.set_variable("ElectromagneticForcesCalc_Load", True)

mc.do_magnetic_calculation()
orders, amp, ang = mc.get_magnetic_graph_harmonics("PhaseCurrent1")
amplitude_expected = mc.get_variable("PeakCurrent")
phase_expected = mc.get_variable("PhaseAdvance") - 90
assert len(orders) == 2
assert len(amp) == 2
assert len(ang) == 2
assert orders[1] == 1
assert almost_equal(amp[1], amplitude_expected)
assert almost_equal(ang[1], phase_expected)


# #Not fully ready submitted an issue
# def test_get_fea_graph_point():
# reset_to_default_file(mc)
Expand Down

0 comments on commit b3ecc74

Please sign in to comment.