8000 add documentation for use_numpy_matrix (#323) · Gonewithwind0/python-control@b5aaf4a · GitHub
[go: up one dir, main page]

Skip to content

Commit b5aaf4a

Browse files
authored
add documentation for use_numpy_matrix (python-control#323)
1 parent de9e3e7 commit b5aaf4a

File tree

3 files changed

+22
-2
lines changed

3 files changed

+22
-2
lines changed

control/config.py

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
_use_numpy_matrix = True # Decide whether to use numpy.marix
2121

2222
def reset_defaults():
23-
"""Reset configuration values to their default values."""
23+
"""Reset package configuration values to their default values."""
2424
global bode_dB; bode_dB = False
2525
global bode_deg; bode_deg = True
2626
global bode_Hz; bode_Hz = False
@@ -61,6 +61,22 @@ def use_fbs_defaults():
6161

6262
# Decide whether to use numpy.matrix for state space operations
6363
def use_numpy_matrix(flag=True, warn=True):
64+
"""Turn on/off use of Numpy `matrix` class for state space operations.
65+
66+
Parameters
67+
----------
68+ 10000
flag : bool
69+
If flag is `True` (default), use the Numpy (soon to be deprecated)
70+
`matrix` class to represent matrices in the `~control.StateSpace`
71+
class and functions. If flat is `False`, then matrices are represnted
72+
by a 2D `ndarray` object.
73+
74+
warn : bool
75+
If flag is `True` (default), issue a warning when turning on the use
76+
of the Numpy `matrix` class. Set `warn` to false to omit display of
77+
the warning message.
78+
79+
"""
6480
if flag and warn:
6581
warnings.warn("Return type numpy.matrix is soon to be deprecated.",
6682
stacklevel=2)

doc/control.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ Utility functions and conversions
156156
observable_form
157157
pade
158158
reachable_form
159+
reset_defaults
159160
sample_system
160161
ss2tf
161162
ssdata
@@ -166,3 +167,4 @@ Utility functions and conversions
166167
unwrap
167168
use_fbs_defaults
168169
use_matlab_defaults
170+
use_numpy_matrix

doc/conventions.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,8 @@ Functions that can be used to set standard configurations:
209209

210210
.. autosummary::
211211
:toctree: generated/
212-
212+
213+
reset_defaults
213214
use_fbs_defaults
214215
use_matlab_defaults
216+
use_numpy_matrix

0 commit comments

Comments
 (0)
0