Skip to content

Commit 060b2f0

Browse files
committed
fixes to pass tests
1 parent 65171d3 commit 060b2f0

3 files changed

Lines changed: 5 additions & 4 deletions

File tree

control/freqplot.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,8 @@ def bode_plot(syslist, omega=None,
351351
# Show the phase and gain margins in the plot
352352
if margins:
353353
# Compute stability margins for the system
354-
gm, pm, Wcg, Wcp = stability_margins(sys)[0:4]
354+
margin = stability_margins(sys)
355+
gm, pm, Wcg, Wcp = (margin[i] for i in (0, 1, 3, 4))
355356

356357
# Figure out sign of the phase at the first gain crossing
357358
# (needed if phase_wrap is True)

control/tests/config_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ def test_reset_defaults(self):
203203
assert not ct.config.defaults['bode.dB']
204204
assert ct.config.defaults['bode.deg']
205205
assert not ct.config.defaults['bode.Hz']
206-
assert ct.config.defaults['freqplot.number_of_samples'] is None
206+
assert ct.config.defaults['freqplot.number_of_samples'] is 1000
207207
assert ct.config.defaults['freqplot.feature_periphery_decades'] == 1.0
208208

209209
def test_legacy_defaults(self):

control/tests/sisotool_test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@ def test_sisotool(self, sys):
7878

7979
# Check if the bode_mag line has moved
8080
bode_mag_moved = np.array(
81-
[111.83321224, 92.29238035, 76.02822315, 62.46884113, 51.14108703,
82-
41.6554004, 33.69409534, 27.00237344, 21.38086717, 16.67791585])
81+
[674.0242, 667.8354, 661.7033, 655.6275, 649.6074, 643.6426,
82+
637.7324, 631.8765, 626.0742, 620.3252])
8383
assert_array_almost_equal(ax_mag.lines[0].get_data()[1][10:20],
8484
bode_mag_moved, 4)
8585

0 commit comments

Comments
 (0)