Skip to content

Commit ec42737

Browse files
authored
deprecate np.matrix usage (#486)
* deprecate np.matrix usage * print pytest summary for all except passing
1 parent c432fd5 commit ec42737

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
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) = \

setup.cfg

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,5 @@
22
universal=1
33

44
[tool:pytest]
5-
filterwarnings =
6-
ignore:.*matrix subclass:PendingDeprecationWarning
5+
addopts = -ra
76

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy