@@ -98,9 +98,10 @@ def test_nyquist_basic():
98
98
count , contour_indented = ct .nyquist_plot (
99
99
sys , np .linspace (1e-4 , 1e2 , 100 ), return_contour = True )
100
100
assert not all (contour_indented .real == 0 )
101
- count , contour = ct .nyquist_plot (
102
- sys , np .linspace (1e-4 , 1e2 , 100 ), return_contour = True ,
103
- indent_direction = 'none' )
101
+ with pytest .warns (UserWarning , match = "encirclements does not match" ):
102
+ count , contour = ct .nyquist_plot (
103
+ sys , np .linspace (1e-4 , 1e2 , 100 ), return_contour = True ,
104
+ indent_direction = 'none' )
104
105
np .testing .assert_almost_equal (contour , 1j * np .linspace (1e-4 , 1e2 , 100 ))
105
106
106
107
# Nyquist plot with poles at the origin, omega unspecified
@@ -166,10 +167,11 @@ def test_nyquist_fbs_examples():
166
167
167
168
plt .figure ()
168
169
plt .title ("Figure 10.10: L(s) = 3 (s+6)^2 / (s (s+1)^2) [zoom]" )
169
- count = ct .nyquist_plot (sys , omega_limits = [1.5 , 1e3 ])
170
- # Frequency limits for zoom give incorrect encirclement count
171
- # assert _Z(sys) == count + _P(sys)
172
- assert count == - 1
170
+ with pytest .warns (UserWarning , match = "encirclements does not match" ):
171
+ count = ct .nyquist_plot (sys , omega_limits = [1.5 , 1e3 ])
172
+ # Frequency limits for zoom give incorrect encirclement count
173
+ # assert _Z(sys) == count + _P(sys)
174
+ assert count == - 1
173
175
174
176
175
177
@pytest .mark .parametrize ("arrows" , [
@@ -276,8 +278,9 @@ def test_nyquist_indent_im():
276
278
277
279
# Imaginary poles with no indentation
278
280
plt .figure ();
279
- count = ct .nyquist_plot (
280
- sys , np .linspace (0 , 1e3 , 1000 ), indent_direction = 'none' )
281
+ with pytest .warns (UserWarning , match = "encirclements does not match" ):
282
+ count = ct .nyquist_plot (
283
+ sys , np .linspace (0 , 1e3 , 1000 ), indent_direction = 'none' )
281
284
plt .title (
282
285
"Imaginary poles; indent_direction='none'; encirclements = %d" % count )
283
286
assert _Z (sys ) == count + _P (sys )
0 commit comments