Skip to content

Commit f835439

Browse files
jamestjspclaude
andcommitted
fix: replace remaining slicot refs in test files
Variable names (slicot.routine()), HAS_SLICOT, importorskip("slicot") were missed in the initial bulk rename. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 5ae0226 commit f835439

33 files changed

+352
-352
lines changed

tests/python/debug_mb03lf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
"""Debug script to trace MB03LF NEIG calculation."""
33
import numpy as np
44
import sys
5-
sys.path.insert(0, '/Users/josephj/Workspace/slicot.c')
6-
from python.slicot import mb03lf
5+
sys.path.insert(0, '/Users/josephj/Workspace/ctrlsys.c')
6+
from python.ctrlsys import mb03lf
77

88
n = 8
99
m = n // 2

tests/python/test_mb02wd.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def test_upper_triangle(self):
2222

2323
x_expected = np.array([0.03614457831325301, 0.21686746987951808, 0.42168674698795183])
2424

25-
x_out, iterations, residual, iwarn, info = slicot.mb02wd('U', 100, a, b, x, 1e-12)
25+
x_out, iterations, residual, iwarn, info = ctrlsys.mb02wd('U', 100, a, b, x, 1e-12)
2626

2727
assert info == 0, f"MB02WD returned info = {info}"
2828
np.testing.assert_allclose(x_out, x_expected, rtol=1e-10)
@@ -40,7 +40,7 @@ def test_lower_triangle(self):
4040

4141
x_expected = np.array([0.03614457831325301, 0.21686746987951808, 0.42168674698795183])
4242

43-
x_out, iterations, residual, iwarn, info = slicot.mb02wd('L', 100, a, b, x, 1e-12)
43+
x_out, iterations, residual, iwarn, info = ctrlsys.mb02wd('L', 100, a, b, x, 1e-12)
4444

4545
assert info == 0, f"MB02WD returned info = {info}"
4646
np.testing.assert_allclose(x_out, x_expected, rtol=1e-10)
@@ -52,7 +52,7 @@ def test_identity_matrix(self):
5252
b = np.array([1.0, 2.0, 3.0, 4.0], dtype=np.float64)
5353
x = np.zeros(n, dtype=np.float64)
5454

55-
x_out, iterations, residual, iwarn, info = slicot.mb02wd('U', 100, a, b, x, 1e-14)
55+
x_out, iterations, residual, iwarn, info = ctrlsys.mb02wd('U', 100, a, b, x, 1e-14)
5656

5757
assert info == 0, f"MB02WD returned info = {info}"
5858
np.testing.assert_allclose(x_out, b, rtol=1e-12)
@@ -72,7 +72,7 @@ def test_zero_iterations(self):
7272
b = np.array([1.0, 2.0, 3.0], dtype=np.float64)
7373
x = np.zeros(3, dtype=np.float64)
7474

75-
x_out, iterations, residual, iwarn, info = slicot.mb02wd('U', 0, a, b, x, 1e-12)
75+
x_out, iterations, residual, iwarn, info = ctrlsys.mb02wd('U', 0, a, b, x, 1e-12)
7676

7777
assert info == 0
7878
assert iwarn == 2
@@ -87,7 +87,7 @@ def test_larger_system(self):
8787
b = np.ones(n, dtype=np.float64)
8888
x = np.zeros(n, dtype=np.float64)
8989

90-
x_out, iterations, residual, iwarn, info = slicot.mb02wd('U', 200, a, b, x, 1e-12)
90+
x_out, iterations, residual, iwarn, info = ctrlsys.mb02wd('U', 200, a, b, x, 1e-12)
9191

9292
assert info == 0
9393
ax = np.dot(a + a.T - np.diag(np.diag(a)), x_out)

tests/python/test_mb02xd.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def test_mb02xd_basic_full_upper():
3838
AtA = A.T @ A
3939
X_expected = np.linalg.solve(AtA, B)
4040

41-
x, ata, info = slicot.mb02xd('F', 'U', m, n, nrhs, A, B)
41+
x, ata, info = ctrlsys.mb02xd('F', 'U', m, n, nrhs, A, B)
4242

4343
assert info == 0, f"MB02XD failed with info={info}"
4444
np.testing.assert_allclose(x, X_expected, rtol=1e-13, atol=1e-14)
@@ -62,7 +62,7 @@ def test_mb02xd_full_lower():
6262
AtA = A.T @ A
6363
X_expected = np.linalg.solve(AtA, B)
6464

65-
x, ata, info = slicot.mb02xd('F', 'L', m, n, nrhs, A, B)
65+
x, ata, info = ctrlsys.mb02xd('F', 'L', m, n, nrhs, A, B)
6666

6767
assert info == 0, f"MB02XD failed with info={info}"
6868
np.testing.assert_allclose(x, X_expected, rtol=1e-13, atol=1e-14)
@@ -86,7 +86,7 @@ def test_mb02xd_packed_upper():
8686
AtA = A.T @ A
8787
X_expected = np.linalg.solve(AtA, B)
8888

89-
x, ata, info = slicot.mb02xd('P', 'U', m, n, nrhs, A, B)
89+
x, ata, info = ctrlsys.mb02xd('P', 'U', m, n, nrhs, A, B)
9090

9191
assert info == 0, f"MB02XD failed with info={info}"
9292
np.testing.assert_allclose(x, X_expected, rtol=1e-13, atol=1e-14)
@@ -110,7 +110,7 @@ def test_mb02xd_packed_lower():
110110
AtA = A.T @ A
111111
X_expected = np.linalg.solve(AtA, B)
112112

113-
x, ata, info = slicot.mb02xd('P', 'L', m, n, nrhs, A, B)
113+
x, ata, info = ctrlsys.mb02xd('P', 'L', m, n, nrhs, A, B)
114114

115115
assert info == 0, f"MB02XD failed with info={info}"
116116
np.testing.assert_allclose(x, X_expected, rtol=1e-13, atol=1e-14)
@@ -133,7 +133,7 @@ def test_mb02xd_singular_matrix():
133133

134134
B = np.array([[1.0], [2.0], [3.0]], order='F', dtype=np.float64)
135135

136-
x, ata, info = slicot.mb02xd('F', 'U', m, n, nrhs, A, B)
136+
x, ata, info = ctrlsys.mb02xd('F', 'U', m, n, nrhs, A, B)
137137

138138
assert info > 0, f"Expected info > 0 for singular matrix, got {info}"
139139

@@ -146,12 +146,12 @@ def test_mb02xd_parameter_errors():
146146
A = np.ones((m, n), order='F', dtype=np.float64)
147147
B = np.ones((n, nrhs), order='F', dtype=np.float64)
148148

149-
x, ata, info = slicot.mb02xd('X', 'U', m, n, nrhs, A, B)
149+
x, ata, info = ctrlsys.mb02xd('X', 'U', m, n, nrhs, A, B)
150150
assert info == -2, f"Expected info=-2 for invalid STOR, got {info}"
151151

152152
A = np.ones((m, n), order='F', dtype=np.float64)
153153
B = np.ones((n, nrhs), order='F', dtype=np.float64)
154-
x, ata, info = slicot.mb02xd('F', 'U', -1, n, nrhs, A, B)
154+
x, ata, info = ctrlsys.mb02xd('F', 'U', -1, n, nrhs, A, B)
155155
assert info == -5, f"Expected info=-5 for M<0, got {info}"
156156

157157

@@ -172,7 +172,7 @@ def test_mb02xd_residual_property():
172172

173173
AtA = A.T @ A
174174

175-
x, ata, info = slicot.mb02xd('F', 'U', m, n, nrhs, A, B)
175+
x, ata, info = ctrlsys.mb02xd('F', 'U', m, n, nrhs, A, B)
176176

177177
assert info == 0, f"MB02XD failed with info={info}"
178178

tests/python/test_mb03bd.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -369,9 +369,9 @@ def test_mb03bd_negative_signature():
369369
eig_slicot = []
370370
for i in range(n):
371371
if beta[i] != 0:
372-
eig_slicot.append((alphar[i] + 1j * alphai[i]) / beta[i] * (base ** scal[i]))
372+
eig_ctrlsys.append((alphar[i] + 1j * alphai[i]) / beta[i] * (base ** scal[i]))
373373
else:
374-
eig_slicot.append(np.inf)
374+
eig_ctrlsys.append(np.inf)
375375
eig_slicot = np.array(eig_slicot)
376376

377377
# Sort and compare

tests/python/test_mb04nd.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ def test_mb04nd_basic_full():
7878

7979
from ctrlsys import _slicot
8080

81-
tau = _slicot.mb04nd('F', n, m, p, r_work, a_work, b_work, c_work)
81+
tau = _ctrlsys.mb04nd('F', n, m, p, r_work, a_work, b_work, c_work)
8282

8383
assert len(tau) == n
8484
assert np.all(np.isfinite(r_work))
@@ -115,7 +115,7 @@ def test_mb04nd_upper_triangular():
115115

116116
from ctrlsys import _slicot
117117

118-
tau = _slicot.mb04nd('U', n, m, p, r_work, a_work, b_work, c_work)
118+
tau = _ctrlsys.mb04nd('U', n, m, p, r_work, a_work, b_work, c_work)
119119

120120
assert len(tau) == n
121121
for i in range(n):
@@ -146,7 +146,7 @@ def test_mb04nd_orthogonality():
146146

147147
from ctrlsys import _slicot
148148

149-
tau = _slicot.mb04nd('F', n, m, p, r_work, a_work, b_work, c_work)
149+
tau = _ctrlsys.mb04nd('F', n, m, p, r_work, a_work, b_work, c_work)
150150

151151
q = np.eye(n + p, dtype=float)
152152
for i in range(n - 1, -1, -1):
@@ -189,7 +189,7 @@ def test_mb04nd_n_zero():
189189

190190
from ctrlsys import _slicot
191191

192-
tau = _slicot.mb04nd('F', n, m, p, r_work, a_work, b_work, c_work)
192+
tau = _ctrlsys.mb04nd('F', n, m, p, r_work, a_work, b_work, c_work)
193193

194194
assert len(tau) == 0
195195
np.testing.assert_array_equal(c_work, c_orig)
@@ -218,7 +218,7 @@ def test_mb04nd_p_zero():
218218

219219
from ctrlsys import _slicot
220220

221-
tau = _slicot.mb04nd('F', n, m, p, r_work, a_work, b_work, c_work)
221+
tau = _ctrlsys.mb04nd('F', n, m, p, r_work, a_work, b_work, c_work)
222222

223223
assert len(tau) == n
224224
np.testing.assert_array_equal(r_work, r_orig)
@@ -248,7 +248,7 @@ def test_mb04nd_m_zero():
248248

249249
from ctrlsys import _slicot
250250

251-
tau = _slicot.mb04nd('F', n, m, p, r_work, a_work, b_work, c_work)
251+
tau = _ctrlsys.mb04nd('F', n, m, p, r_work, a_work, b_work, c_work)
252252

253253
assert len(tau) == n
254254
for i in range(n):
@@ -278,7 +278,7 @@ def test_mb04nd_large_matrix():
278278

279279
from ctrlsys import _slicot
280280

281-
tau = _slicot.mb04nd('F', n, m, p, r_work, a_work, b_work, c_work)
281+
tau = _ctrlsys.mb04nd('F', n, m, p, r_work, a_work, b_work, c_work)
282282

283283
assert len(tau) == n
284284
for i in range(n):
@@ -313,7 +313,7 @@ def test_mb04nd_n_greater_p():
313313

314314
from ctrlsys import _slicot
315315

316-
tau = _slicot.mb04nd('U', n, m, p, r_work, a_work, b_work, c_work)
316+
tau = _ctrlsys.mb04nd('U', n, m, p, r_work, a_work, b_work, c_work)
317317

318318
assert len(tau) == n
319319
for i in range(n):

tests/python/test_mb04ny.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ def test_mb04ny_basic_2x2():
7878

7979
a_out = a.copy(order='F')
8080
b_out = b.copy(order='F')
81-
_slicot.mb04ny(m, n, v, incv, tau, a_out, b_out)
81+
_ctrlsys.mb04ny(m, n, v, incv, tau, a_out, b_out)
8282

8383
np.testing.assert_allclose(a_out, a_expected, rtol=1e-14)
8484
np.testing.assert_allclose(b_out, b_expected, rtol=1e-14)
@@ -106,7 +106,7 @@ def test_mb04ny_3x3():
106106

107107
a_out = a.copy(order='F')
108108
b_out = b.copy(order='F')
109-
_slicot.mb04ny(m, n, v, incv, tau, a_out, b_out)
109+
_ctrlsys.mb04ny(m, n, v, incv, tau, a_out, b_out)
110110

111111
np.testing.assert_allclose(a_out, a_expected, rtol=1e-14)
112112
np.testing.assert_allclose(b_out, b_expected, rtol=1e-14)
@@ -134,7 +134,7 @@ def test_mb04ny_5x5():
134134

135135
a_out = a.copy(order='F')
136136
b_out = b.copy(order='F')
137-
_slicot.mb04ny(m, n, v, incv, tau, a_out, b_out)
137+
_ctrlsys.mb04ny(m, n, v, incv, tau, a_out, b_out)
138138

139139
np.testing.assert_allclose(a_out, a_expected, rtol=1e-13)
140140
np.testing.assert_allclose(b_out, b_expected, rtol=1e-13)
@@ -162,7 +162,7 @@ def test_mb04ny_10x10():
162162

163163
a_out = a.copy(order='F')
164164
b_out = b.copy(order='F')
165-
_slicot.mb04ny(m, n, v, incv, tau, a_out, b_out)
165+
_ctrlsys.mb04ny(m, n, v, incv, tau, a_out, b_out)
166166

167167
np.testing.assert_allclose(a_out, a_expected, rtol=1e-12)
168168
np.testing.assert_allclose(b_out, b_expected, rtol=1e-12)
@@ -190,7 +190,7 @@ def test_mb04ny_large_general():
190190

191191
a_out = a.copy(order='F')
192192
b_out = b.copy(order='F')
193-
_slicot.mb04ny(m, n, v, incv, tau, a_out, b_out)
193+
_ctrlsys.mb04ny(m, n, v, incv, tau, a_out, b_out)
194194

195195
np.testing.assert_allclose(a_out, a_expected, rtol=1e-13)
196196
np.testing.assert_allclose(b_out, b_expected, rtol=1e-13)
@@ -219,7 +219,7 @@ def test_mb04ny_tau_zero():
219219

220220
a_out = a.copy(order='F')
221221
b_out = b.copy(order='F')
222-
_slicot.mb04ny(m, n, v, incv, tau, a_out, b_out)
222+
_ctrlsys.mb04ny(m, n, v, incv, tau, a_out, b_out)
223223

224224
np.testing.assert_allclose(a_out, a_expected, rtol=1e-14)
225225
np.testing.assert_allclose(b_out, b_expected, rtol=1e-14)
@@ -262,7 +262,7 @@ def test_mb04ny_m_zero():
262262

263263
a_out = a.copy(order='F')
264264
b_out = b.copy(order='F')
265-
_slicot.mb04ny(m, n, v, incv, tau, a_out, b_out)
265+
_ctrlsys.mb04ny(m, n, v, incv, tau, a_out, b_out)
266266

267267
assert a_out.shape == (0, 1)
268268
assert b_out.shape == (0, n)
@@ -290,7 +290,7 @@ def test_mb04ny_n_zero():
290290

291291
a_out = a.copy(order='F')
292292
b_out = b.copy(order='F')
293-
_slicot.mb04ny(m, n, v, incv, tau, a_out, b_out)
293+
_ctrlsys.mb04ny(m, n, v, incv, tau, a_out, b_out)
294294

295295
np.testing.assert_allclose(a_out, a_expected, rtol=1e-14)
296296
assert b_out.shape == (m, 0)
@@ -319,7 +319,7 @@ def test_mb04ny_incv_positive():
319319

320320
a_out = a.copy(order='F')
321321
b_out = b.copy(order='F')
322-
_slicot.mb04ny(m, n, v, incv, tau, a_out, b_out)
322+
_ctrlsys.mb04ny(m, n, v, incv, tau, a_out, b_out)
323323

324324
np.testing.assert_allclose(a_out, a_expected, rtol=1e-14)
325325
np.testing.assert_allclose(b_out, b_expected, rtol=1e-14)
@@ -346,7 +346,7 @@ def test_mb04ny_incv_negative():
346346

347347
a_out = a.copy(order='F')
348348
b_out = b.copy(order='F')
349-
_slicot.mb04ny(m, n, v, incv, tau, a_out, b_out)
349+
_ctrlsys.mb04ny(m, n, v, incv, tau, a_out, b_out)
350350

351351
np.testing.assert_allclose(a_out, a_expected, rtol=1e-14)
352352
np.testing.assert_allclose(b_out, b_expected, rtol=1e-14)
@@ -373,7 +373,7 @@ def test_mb04ny_single_row():
373373

374374
a_out = a.copy(order='F')
375375
b_out = b.copy(order='F')
376-
_slicot.mb04ny(m, n, v, incv, tau, a_out, b_out)
376+
_ctrlsys.mb04ny(m, n, v, incv, tau, a_out, b_out)
377377

378378
np.testing.assert_allclose(a_out, a_expected, rtol=1e-14)
379379
np.testing.assert_allclose(b_out, b_expected, rtol=1e-14)

tests/python/test_md03bd.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import numpy as np
22
import pytest
33

4-
pytest.importorskip("slicot")
4+
pytest.importorskip("ctrlsys")
55
import ctrlsys
66

77

@@ -57,7 +57,7 @@ def jac(x):
5757
gtol = -1.0 # Use eps
5858

5959
# Call MD03BD
60-
x, nfev, njev, fnorm, iwarn, info = slicot.md03bd(
60+
x, nfev, njev, fnorm, iwarn, info = ctrlsys.md03bd(
6161
m, n, x0, fcn, jac,
6262
itmax=100,
6363
ftol=ftol,
@@ -106,7 +106,7 @@ def jac(x):
106106
j[:, 1] = -1.0
107107
return j
108108

109-
x, nfev, njev, fnorm, iwarn, info = slicot.md03bd(
109+
x, nfev, njev, fnorm, iwarn, info = ctrlsys.md03bd(
110110
m, n, x0, fcn, jac,
111111
itmax=50,
112112
ftol=-1.0,
@@ -132,4 +132,4 @@ def jac(x):
132132
return np.zeros((m, n), dtype=np.float64, order='F')
133133

134134
with pytest.raises((ValueError, RuntimeError)):
135-
slicot.md03bd(m, n, x0, fcn, jac, itmax=10)
135+
ctrlsys.md03bd(m, n, x0, fcn, jac, itmax=10)

tests/python/test_md03bf.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616

1717
try:
1818
from ctrlsys import md03bf
19-
HAS_SLICOT = True
19+
HAS_CTRLSYS = True
2020
except ImportError:
21-
HAS_SLICOT = False
21+
HAS_CTRLSYS = False
2222

2323

2424
def compute_kowalik_osborne_error(x):
@@ -67,7 +67,7 @@ def compute_kowalik_osborne_jacobian(x):
6767
return j
6868

6969

70-
@pytest.mark.skipif(not HAS_SLICOT, reason="SLICOT not available")
70+
@pytest.mark.skipif(not HAS_CTRLSYS, reason="SLICOT not available")
7171
class TestMd03bf:
7272
"""Tests for MD03BF Kowalik-Osborne FCN callback."""
7373

0 commit comments

Comments
 (0)