Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

deprecate np.matrix usage#486

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
murrayrm merged 2 commits intopython-control:masterfrombnavigator:deprecate-matrix
Dec 30, 2020
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletionscontrol/config.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -144,7 +144,7 @@ def use_numpy_matrix(flag=True, warn=True):
Parameters
----------
flag : bool
If flag is `True` (default), use theNumpy (soon to bedeprecated)
If flag is `True` (default), use the deprecated Numpy
`matrix` class to represent matrices in the `~control.StateSpace`
class and functions. If flat is `False`, then matrices are
represented by a 2D `ndarray` object.
Expand All@@ -161,8 +161,8 @@ class and functions. If flat is `False`, then matrices are
space operations is a 2D array.
"""
if flag and warn:
warnings.warn("Return type numpy.matrix issoon to bedeprecated.",
stacklevel=2)
warnings.warn("Return type numpy.matrix is deprecated.",
stacklevel=2, category=DeprecationWarning)
set_defaults('statesp', use_numpy_matrix=flag)

def use_legacy_defaults(version):
Expand All@@ -171,7 +171,7 @@ def use_legacy_defaults(version):
Parameters
----------
version : string
Version number of the defaults desired. Ranges from '0.1' to '0.8.4'.
Version number of the defaults desired. Ranges from '0.1' to '0.8.4'.
"""
import re
(major, minor, patch) = (None, None, None) # default values
Expand All@@ -189,7 +189,7 @@ def use_legacy_defaults(version):
match = re.match("[vV]?0.([3-6])([a-d])", version)
if match: (major, minor, patch) = \
(0, int(match.group(1)), ord(match.group(2)) - ord('a') + 1)

# Abbreviated version format: vM.N or M.N
match = re.match("([vV]?[0-9]).([0-9])", version)
if match: (major, minor, patch) = \
Expand Down
3 changes: 1 addition & 2 deletionssetup.cfg
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,6 +2,5 @@
universal=1

[tool:pytest]
filterwarnings =
ignore:.*matrix subclass:PendingDeprecationWarning
addopts = -ra


[8]ページ先頭

©2009-2025 Movatter.jp