Skip to content

Commit

Permalink
clear figure in unit tests to avoid slow plotting problem
Browse files Browse the repository at this point in the history
  • Loading branch information
murrayrm committed Jan 2, 2021
1 parent fe9928b commit 2702ee7
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions control/tests/freqresp_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,11 +304,10 @@ def test_initial_phase(TF, initial_phase, default_phase, expected_phase):
assert(abs(phase[0] - expected_phase) < 0.1)

# Make sure everything works in rad/sec as well
# Turn off plotting since that seems to slow things down a lot (?)
if initial_phase:
plt.clf() # clear previous figure (speeds things up)
mag, phase, omega = ctrl.bode(
TF, initial_phase=initial_phase/180. * math.pi, deg=False,
plot=False)
TF, initial_phase=initial_phase/180. * math.pi, deg=False)
assert(abs(phase[0] - expected_phase) < 0.1)


Expand Down

0 comments on commit 2702ee7

Please sign in to comment.