Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
18 changes: 17 additions & 1 deletion control/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
_use_numpy_matrix = True # Decide whether to use numpy.marix

def reset_defaults():
"""Reset configuration values to their default values."""
"""Reset package configuration values to their default values."""
global bode_dB; bode_dB = False
global bode_deg; bode_deg = True
global bode_Hz; bode_Hz = False
Expand Down Expand Up @@ -61,6 +61,22 @@ def use_fbs_defaults():

# Decide whether to use numpy.matrix for state space operations
def use_numpy_matrix(flag=True, warn=True):
"""Turn on/off use of Numpy `matrix` class for state space operations.

Parameters
----------
flag : bool
If flag is `True` (default), use the Numpy (soon to be deprecated)
`matrix` class to represent matrices in the `~control.StateSpace`
class and functions. If flat is `False`, then matrices are represnted

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo in represented

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. Will fix that in a subsequent PR.

by a 2D `ndarray` object.

warn : bool
If flag is `True` (default), issue a warning when turning on the use
of the Numpy `matrix` class. Set `warn` to false to omit display of
the warning message.

"""
if flag and warn:
warnings.warn("Return type numpy.matrix is soon to be deprecated.",
stacklevel=2)
Expand Down
2 changes: 2 additions & 0 deletions doc/control.rst
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ Utility functions and conversions
observable_form
pade
reachable_form
reset_defaults
sample_system
ss2tf
ssdata
Expand All @@ -166,3 +167,4 @@ Utility functions and conversions
unwrap
use_fbs_defaults
use_matlab_defaults
use_numpy_matrix
4 changes: 3 additions & 1 deletion doc/conventions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,8 @@ Functions that can be used to set standard configurations:

.. autosummary::
:toctree: generated/


reset_defaults
use_fbs_defaults
use_matlab_defaults
use_numpy_matrix