Skip to content

Commit d1cf152

Browse files
authored
Merge pull request #1036 from murrayrm/test_matrix_update-06Aug2024
Update OS/BLAS test matrix workflow
2 parents b385a9e + 25e9474 commit d1cf152

File tree

2 files changed

+12
-15
lines changed

2 files changed

+12
-15
lines changed

.github/workflows/os-blas-test-matrix.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ jobs:
7171
unset | Generic | Apple ) ;; # Found in system
7272
OpenBLAS )
7373
brew install openblas
74-
echo "BLAS_ROOT=/usr/local/opt/openblas/" >> $GITHUB_ENV
75-
echo "LAPACK_ROOT=/usr/local/opt/openblas/" >> $GITHUB_ENV
74+
echo "LDFLAGS=-L/opt/homebrew/opt/openblas/lib" >> $GITHUB_ENV
75+
echo "CPPFLAGS=-I/opt/homebrew/opt/openblas/include" >> $GITHUB_ENV
7676
;;
7777
*)
7878
echo "bla_vendor option ${{ matrix.bla_vendor }} not supported"
@@ -204,8 +204,6 @@ jobs:
204204
path: slycot-src
205205
- name: Checkout python-control
206206
uses: actions/checkout@v3
207-
with:
208-
repository: 'python-control/python-control'
209207
- name: Setup Python
210208
uses: actions/setup-python@v4
211209
with:

control/tests/nyquist_test.py

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -132,18 +132,17 @@ def test_nyquist_basic():
132132
# Nyquist plot with poles on imaginary axis, omega specified
133133
# (can miss encirclements due to the imaginary poles at +/- 1j)
134134
sys = ct.tf([1], [1, 3, 2]) * ct.tf([1], [1, 0, 1])
135-
with pytest.warns(UserWarning, match="does not match") as records:
135+
with warnings.catch_warnings(record=True) as records:
136136
count = ct.nyquist_response(sys, np.linspace(1e-3, 1e1, 1000))
137-
if len(records) == 0:
138-
assert _Z(sys) == count + _P(sys)
139-
140-
# Nyquist plot with poles on imaginary axis, omega specified, with contour
141-
sys = ct.tf([1], [1, 3, 2]) * ct.tf([1], [1, 0, 1])
142-
with pytest.warns(UserWarning, match="does not match") as records:
143-
count, contour = ct.nyquist_response(
144-
sys, np.linspace(1e-3, 1e1, 1000), return_contour=True)
145-
if len(records) == 0:
146-
assert _Z(sys) == count + _P(sys)
137+
if len(records) == 0:
138+
# No warnings (it happens) => make sure count is correct
139+
assert _Z(sys) == count + _P(sys)
140+
elif len(records) == 1:
141+
# Expected case: make sure warning is the right one
142+
assert issubclass(records[0].category, UserWarning)
143+
assert "encirclements does not match" in str(records[0].message)
144+
else:
145+
pytest.fail("multiple warnings in nyquist_response (?)")
147146

148147
# Nyquist plot with poles on imaginary axis, return contour
149148
sys = ct.tf([1], [1, 3, 2]) * ct.tf([1], [1, 0, 1])

0 commit comments

Comments
 (0)