8000 clear figure in unit tests to avoid slow plotting problem · python-control/python-control@2702ee7 · GitHub
[go: up one dir, main page]

Skip to content

Commit 2702ee7

Browse files
committed
clear figure in unit tests to avoid slow plotting problem
1 parent fe9928b commit 2702ee7

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

control/tests/freqresp_test.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -304,11 +304,10 @@ def test_initial_phase(TF, initial_phase, default_phase, expected_phase):
304304
assert(abs(phase[0] - expected_phase) < 0.1)
305305

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

314313

0 commit comments

Comments
 (0)
0