Skip to content

Commit adc8166

Browse files
committed
update tests for dt=0, remove the test_copy_constructor_nodt
1 parent e3a0070 commit adc8166

File tree

3 files changed

+1
-29
lines changed

3 files changed

+1
-29
lines changed

control/tests/discrete_test.py

-12
Original file line numberDiff line numberDiff line change
@@ -243,8 +243,6 @@ def testAddition(self, tsys):
243243
StateSpace.__add__(tsys.mimo_ss1c, tsys.mimo_ss1d)
244244
with pytest.raises(ValueError):
245245
StateSpace.__add__(tsys.mimo_ss1d, tsys.mimo_ss2d)
246-
with pytest.raises(ValueError):
247-
StateSpace.__add__(tsys.siso_ss1d, tsys.siso_ss3d)
248246

249247
# Transfer function addition
250248
sys = tsys.siso_tf1 + tsys.siso_tf1d
@@ -260,8 +258,6 @@ def testAddition(self, tsys):
260258
TransferFunction.__add__(tsys.siso_tf1c, tsys.siso_tf1d)
261259
with pytest.raises(ValueError):
262260
TransferFunction.__add__(tsys.siso_tf1d, tsys.siso_tf2d)
263-
with pytest.raises(ValueError):
264-
TransferFunction.__add__(tsys.siso_tf1d, tsys.siso_tf3d)
265261

266262
# State space + transfer function
267263
sys = tsys.siso_ss1c + tsys.siso_tf1c
@@ -285,8 +281,6 @@ def testMultiplication(self, tsys):
285281
StateSpace.__mul__(tsys.mimo_ss1c, tsys.mimo_ss1d)
286282
with pytest.raises(ValueError):
287283
StateSpace.__mul__(tsys.mimo_ss1d, tsys.mimo_ss2d)
288-
with pytest.raises(ValueError):
289-
StateSpace.__mul__(tsys.siso_ss1d, tsys.siso_ss3d)
290284

291285
# Transfer function multiplication
292286
sys = tsys.siso_tf1 * tsys.siso_tf1d
@@ -301,8 +295,6 @@ def testMultiplication(self, tsys):
301295
TransferFunction.__mul__(tsys.siso_tf1c, tsys.siso_tf1d)
302296
with pytest.raises(ValueError):
303297
TransferFunction.__mul__(tsys.siso_tf1d, tsys.siso_tf2d)
304-
with pytest.raises(ValueError):
305-
TransferFunction.__mul__(tsys.siso_tf1d, tsys.siso_tf3d)
306298

307299
# State space * transfer function
308300
sys = tsys.siso_ss1c * tsys.siso_tf1c
@@ -328,8 +320,6 @@ def testFeedback(self, tsys):
328320
feedback(tsys.mimo_ss1c, tsys.mimo_ss1d)
329321
with pytest.raises(ValueError):
330322
feedback(tsys.mimo_ss1d, tsys.mimo_ss2d)
331-
with pytest.raises(ValueError):
332-
feedback(tsys.siso_ss1d, tsys.siso_ss3d)
333323

334324
# Transfer function feedback
335325
sys = feedback(tsys.siso_tf1, tsys.siso_tf1d)
@@ -344,8 +334,6 @@ def testFeedback(self, tsys):
344334
feedback(tsys.siso_tf1c, tsys.siso_tf1d)
345335
with pytest.raises(ValueError):
346336
feedback(tsys.siso_tf1d, tsys.siso_tf2d)
347-
with pytest.raises(ValueError):
348-
feedback(tsys.siso_tf1d, tsys.siso_tf3d)
349337

350338
# State space, transfer function
351339
sys = feedback(tsys.siso_ss1c, tsys.siso_tf1c)

control/tests/iosys_test.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1024,7 +1024,7 @@ def test_duplicates(self, tsys):
10241024
# Nonduplicate objects
10251025
nlios1 = nlios.copy()
10261026
nlios2 = nlios.copy()
1027-
with pytest.warns(UserWarning, match="copy of sys") as record:
1027+
with pytest.warns(UserWarning, match="Duplicate name"):
10281028
ios_series = nlios1 * nlios2
10291029
assert "copy of sys_1.x[0]" in ios_series.state_index.keys()
10301030
assert "copy of sys.x[0]" in ios_series.state_index.keys()

control/tests/statesp_test.py

-16
Original file line numberDiff line numberDiff line change
@@ -164,22 +164,6 @@ def test_copy_constructor(self):
164164
linsys.A[0, 0] = -3
165165
np.testing.assert_array_equal(cpysys.A, [[-1]]) # original value
166166

167-
def test_copy_constructor_nodt(self, sys322):
168-
"""Test the copy constructor when an object without dt is passed
169-
170-
FIXME: may be obsolete in case gh-431 is updated
171-
"""
172-
sysin = sample_system(sys322, 1.)
173-
del sysin.dt
174-
sys = StateSpace(sysin)
175-
assert sys.dt == defaults['control.default_dt']
176-
177-
# test for static gain
178-
sysin = StateSpace([], [], [], [[1, 2], [3, 4]], 1.)
179-
del sysin.dt
180-
sys = StateSpace(sysin)
181-
assert sys.dt is None
182-
183167
def test_matlab_style_constructor(self):
184168
"""Use (deprecated) matrix-style construction string"""
185169
with pytest.deprecated_call():

0 commit comments

Comments
 (0)