Skip to content

Commit f9d4a9c

Browse files
committed
deprecate np.matrix usage
1 parent 51c797e commit f9d4a9c

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

control/config.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ def use_numpy_matrix(flag=True, warn=True):
144144
Parameters
145145
----------
146146
flag : bool
147-
If flag is `True` (default), use the Numpy (soon to be deprecated)
147+
If flag is `True` (default), use the deprecated Numpy
148148
`matrix` class to represent matrices in the `~control.StateSpace`
149149
class and functions. If flat is `False`, then matrices are
150150
represented by a 2D `ndarray` object.
@@ -161,8 +161,8 @@ class and functions. If flat is `False`, then matrices are
161161
space operations is a 2D array.
162162
"""
163163
if flag and warn:
164-
warnings.warn("Return type numpy.matrix is soon to be deprecated.",
165-
stacklevel=2)
164+
warnings.warn("Return type numpy.matrix is deprecated.",
165+
stacklevel=2, category=DeprecationWarning)
166166
set_defaults('statesp', use_numpy_matrix=flag)
167167

168168
def use_legacy_defaults(version):
@@ -171,7 +171,7 @@ def use_legacy_defaults(version):
171171
Parameters
172172
----------
173173
version : string
174-
Version number of the defaults desired. Ranges from '0.1' to '0.8.4'.
174+
Version number of the defaults desired. Ranges from '0.1' to '0.8.4'.
175175
"""
176176
import re
177177
(major, minor, patch) = (None, None, None) # default values
@@ -189,7 +189,7 @@ def use_legacy_defaults(version):
189189
match = re.match("[vV]?0.([3-6])([a-d])", version)
190190
if match: (major, minor, patch) = \
191191
(0, int(match.group(1)), ord(match.group(2)) - ord('a') + 1)
192-
192+
193193
# Abbreviated version format: vM.N or M.N
194194
match = re.match("([vV]?[0-9]).([0-9])", version)
195195
if match: (major, minor, patch) = \

0 commit comments

Comments
 (0)