Skip to content

Commit 5ed0f96

Browse files
committed
fix issue with np.matrix deprecation in iosys_test.py
1 parent 488edf5 commit 5ed0f96

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

control/tests/iosys_test.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,6 @@ def test_linearize(self, tsys, kincar):
205205
np.testing.assert_array_almost_equal(linearized.D, np.zeros((2,2)))
206206

207207
@pytest.mark.usefixtures("editsdefaults")
208-
@matrixfilter # avoid np.matrix warnings in v0.8.4
209208
def test_linearize_named_signals(self, kincar):
210209
# Full form of the call
211210
linearized = kincar.linearize([0, 0, 0], [0, 0], copy=True,
@@ -225,6 +224,7 @@ def test_linearize_named_signals(self, kincar):
225224

226225
# Test legacy version as well
227226
ct.use_legacy_defaults('0.8.4')
227+
ct.config.use_numpy_matrix(False) # np.matrix deprecated
228228
linearized = kincar.linearize([0, 0, 0], [0, 0], copy=True)
229229
assert linearized.name == kincar.name + '_linearized'
230230

@@ -954,12 +954,12 @@ def test_named_signals(self, tsys):
954954
np.testing.assert_array_almost_equal(ss_feedback.D, lin_feedback.D)
955955

956956
@pytest.mark.usefixtures("editsdefaults")
957-
@matrixfilter # avoid np.matrix warnings in v0.8.4
958957
def test_sys_naming_convention(self, tsys):
959958
"""Enforce generic system names 'sys[i]' to be present when systems are
960959
created without explicit names."""
961960

962961
ct.config.use_legacy_defaults('0.8.4') # changed delims in 0.9.0
962+
ct.config.use_numpy_matrix(False) # np.matrix deprecated
963963
ct.InputOutputSystem.idCounter = 0
964964
sys = ct.LinearIOSystem(tsys.mimo_linsys1)
965965

@@ -1014,7 +1014,6 @@ def test_sys_naming_convention(self, tsys):
10141014
unnamedsys1 * unnamedsys1
10151015

10161016
@pytest.mark.usefixtures("editsdefaults")
1017-
@matrixfilter # avoid np.matrix warnings in v0.8.4
10181017
def test_signals_naming_convention_0_8_4(self, tsys):
10191018
"""Enforce generic names to be present when systems are created
10201019
without explicit signal names:
@@ -1024,6 +1023,7 @@ def test_signals_naming_convention_0_8_4(self, tsys):
10241023
"""
10251024

10261025
ct.config.use_legacy_defaults('0.8.4') # changed delims in 0.9.0
1026+
ct.config.use_numpy_matrix(False) # np.matrix deprecated
10271027
ct.InputOutputSystem.idCounter = 0
10281028
sys = ct.LinearIOSystem(tsys.mimo_linsys1)
10291029
for statename in ["x[0]", "x[1]"]:
@@ -1216,7 +1216,6 @@ def test_docstring_example(self):
12161216
np.testing.assert_array_almost_equal(io_S.D, ss_S.D)
12171217

12181218
@pytest.mark.usefixtures("editsdefaults")
1219-
@matrixfilter # avoid np.matrix warnings in v0.8.4
12201219
def test_duplicates(self, tsys):
12211220
nlios = ios.NonlinearIOSystem(lambda t, x, u, params: x,
12221221
lambda t, x, u, params: u * u,
@@ -1229,6 +1228,7 @@ def test_duplicates(self, tsys):
12291228

12301229
# Nonduplicate objects
12311230
ct.config.use_legacy_defaults('0.8.4') # changed delims in 0.9.0
1231+
ct.config.use_numpy_matrix(False) # np.matrix deprecated
12321232
nlios1 = nlios.copy()
12331233
nlios2 = nlios.copy()
12341234
with pytest.warns(UserWarning, match="Duplicate name"):

0 commit comments

Comments
 (0)