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

Commit71101bf

Browse files
authored
Merge pull request#232 from murrayrm/fix-statesp_test-warnings
Fix numpy generated warnings that are breaking unit tests
2 parentsa007fcc +53e0a09 commit71101bf

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

‎control/tests/freqresp_test.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,11 @@ def test_discrete(self):
141141
importwarnings
142142
warnings.simplefilter('always',UserWarning)# don't supress
143143
withwarnings.catch_warnings(record=True)asw:
144+
# Set up warnings filter to only show warnings in control module
145+
warnings.filterwarnings("ignore")
146+
warnings.filterwarnings("always",module="control")
147+
148+
# Look for a warning about sampling above Nyquist frequency
144149
omega_bad=np.linspace(10e-4,1.1,10)*np.pi/sys.dt
145150
ret=sys.freqresp(omega_bad)
146151
print("len(w) =",len(w))

‎control/tests/statesp_test.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,11 @@ def testEvalFr(self):
148148
# Deprecated version of the call (should generate warning)
149149
importwarnings
150150
withwarnings.catch_warnings(record=True)asw:
151-
warnings.simplefilter("always")
151+
# Set up warnings filter to only show warnings in control module
152+
warnings.filterwarnings("ignore")
153+
warnings.filterwarnings("always",module="control")
154+
155+
# Make sure that we get a pending deprecation warning
152156
sys.evalfr(1.)
153157
assertlen(w)==1
154158
assertissubclass(w[-1].category,PendingDeprecationWarning)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp