10BC0 update freqresp_test.py unit test to fix numpy warnings · MaxGaukler/python-control@53e0a09 · GitHub
[go: up one dir, main page]

Skip to content

Commit 53e0a09

Browse files
committed
update freqresp_test.py unit test to fix numpy warnings
1 parent 70bf207 commit 53e0a09

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
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
import warnings
142142
warnings.simplefilter('always', UserWarning) # don't supress
143143
with warnings.catch_warnings(record=True) as w:
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))

0 commit comments

Comments
 (0)
0