Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit6699da0

Browse files
committed
mplcleanup for all nyquist tests
1 parentf46d98e commit6699da0

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

‎control/tests/nyquist_test.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,11 @@
1010

1111
importpytest
1212
importnumpyasnp
13-
importscipyassp
1413
importmatplotlib.pyplotasplt
1514
importcontrolasct
1615

16+
pytestmark=pytest.mark.usefixtures("mplcleanup")
17+
1718

1819
# Utility function for counting unstable poles of open loop (P in FBS)
1920
def_P(sys,indent='right'):
@@ -34,7 +35,6 @@ def _Z(sys):
3435

3536

3637
# Basic tests
37-
@pytest.mark.usefixtures("mplcleanup")
3838
deftest_nyquist_basic():
3939
# Simple Nyquist plot
4040
sys=ct.rss(5,1,1)
@@ -109,7 +109,6 @@ def test_nyquist_basic():
109109

110110

111111
# Some FBS examples, for comparison
112-
@pytest.mark.usefixtures("mplcleanup")
113112
deftest_nyquist_fbs_examples():
114113
s=ct.tf('s')
115114

@@ -151,7 +150,6 @@ def test_nyquist_fbs_examples():
151150
1,2,3,4,# specified number of arrows
152151
[0.1,0.5,0.9],# specify arc lengths
153152
])
154-
@pytest.mark.usefixtures("mplcleanup")
155153
deftest_nyquist_arrows(arrows):
156154
sys=ct.tf([1.4], [1,2,1])*ct.tf(*ct.pade(1,4))
157155
plt.figure();
@@ -160,7 +158,6 @@ def test_nyquist_arrows(arrows):
160158
assert_Z(sys)==count+_P(sys)
161159

162160

163-
@pytest.mark.usefixtures("mplcleanup")
164161
deftest_nyquist_encirclements():
165162
# Example 14.14: effect of friction in a cart-pendulum system
166163
s=ct.tf('s')
@@ -185,7 +182,6 @@ def test_nyquist_encirclements():
185182
assert_Z(sys)==count+_P(sys)
186183

187184

188-
@pytest.mark.usefixtures("mplcleanup")
189185
deftest_nyquist_indent():
190186
# FBS Figure 10.10
191187
s=ct.tf('s')

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp