8000 fix and update scipy intersphinx references · python-control/python-control@c13cc80 · GitHub
[go: up one dir, main page]

Skip to content
8000

Commit c13cc80

Browse files
bnavigatorlaurensvalk
authored andcommitted
fix and update scipy intersphinx references
1 parent 69c33e5 commit c13cc80

File tree

7 files changed

+69
-65
lines changed

7 files changed

+69
-65
lines changed

control/freqplot.py

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -128,21 +128,22 @@ def bode_plot(syslist, omega=None,
128128
----------------
129129
grid : bool
130130
If True, plot grid lines on gain and phase plots. Default is set by
131-
config.defaults['bode.grid'].
131+
`config.defaults['bode.grid']`.
132+
132133
133134
The default values for Bode plot configuration parameters can be reset
134135
using the `config.defaults` dictionary, with module name 'bode'.
135136
136137
Notes
137138
-----
138-
1. Alternatively, you may use the lower-level method (mag, phase, freq)
139-
= sys.freqresp(freq) to generate the frequency response for a system,
140-
but it returns a MIMO response.
139+
1. Alternatively, you may use the lower-level method
140+
``(mag, phase, freq) = sys.freqresp(freq)`` to generate the frequency
141+
response for a system, but it returns a MIMO response.
141142
142143
2. If a discrete time model is given, the frequency response is plotted
143-
along the upper branch of the unit circle, using the mapping z = exp(j
144-
\\omega dt) where omega ranges from 0 to pi/dt and dt is the discrete
145-
timebase. If not timebase is specified (dt = True), dt is set to 1.
144+
along the upper branch of the unit circle, using the mapping z = exp(j
145+
\\omega dt) where omega ranges from 0 to pi/dt and dt is the discrete
146+
timebase. If not timebase is specified (dt = True), dt is set to 1.
146147
147148
Examples
148149
--------
@@ -539,13 +540,13 @@ def nyquist_plot(syslist, omega=None, plot=True, label_freq=0,
539540
ax = plt.gca()
540541
# Plot arrow to indicate Nyquist encirclement orientation
541542
ax.arrow(x[0], y[0], (x[1]-x[0])/2, (y[1]-y[0])/2, fc=c, ec=c,
542-
head_width=arrowhead_width,
543+
head_width=arrowhead_width,
543544
head_length=arrowhead_length)
544545

545546
plt.plot(x, -y, '-', color=c, *args, **kwargs)
546547
ax.arrow(
547548
x[-1], -y[-1], (x[-1]-x[-2])/2, (y[-1]-y[-2])/2,
548-
fc=c, ec=c, head_width=arrowhead_width,
549+
fc=c, ec=c, head_width=arrowhead_width,
549550
head_length=arrowhead_length)
550551

551552
# Mark the -1 point

control/iosys.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1514,8 +1514,9 @@ def find_eqpt(sys, x0, u0=[], y0=None, t=0, params={},
15141514
return_y : bool, optional
15151515
If True, return the value of output at the equilibrium point.
15161516
return_result : bool, optional
1517-
If True, return the `result` option from the scipy root function used
1518-
to compute the equilibrium point.
1517+
If True, return the `result` option from the
1518+
:func:`scipy.optimize.root` function used to compute the equilibrium
1519+
point.
15191520
15201521
Returns
15211522
-------
@@ -1529,9 +1530,9 @@ def find_eqpt(sys, x0, u0=[], y0=None, t=0, params={},
15291530
If `return_y` is True, returns the value of the outputs at the
15301531
equilibrium point, or `None` if no equilibrium point was found and
15311532
`return_result` was False.
1532-
result : scipy root() result object, optional
1533-
If `return_result` is True, returns the `result` from the scipy root
1534-
function.
1533+
result : :class:`scipy.optimize.OptimizeResult`, optional
1534+
If `return_result` is True, returns the `result` from the
1535+
:func:`scipy.optimize.root` function.
15351536
15361537
"""
15371538
from scipy.optimize import root

control/phaseplot.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ def phase_plot(odefun, X=None, Y=None, scale=1, X0=None, T=None,
7373
func : callable(x, t, ...)
7474
Computes the time derivative of y (compatible with odeint).
7575
The function should be the same for as used for
76-
scipy.integrate. Namely, it should be a function of the form
76+
:mod:`scipy.integrate`. Namely, it should be a function of the form
7777
dxdt = F(x, t) that accepts a state x of dimension 2 and
7878
returns a derivative dx/dt of dimension 2.
7979

control/statefbk.py

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
# Pole placement
5454
def place(A, B, p):
5555
"""Place closed loop eigenvalues
56+
5657
K = place(A, B, p)
5758
5859
Parameters
@@ -69,21 +70,24 @@ def place(A, B, p):
6970
K : 2-d array
7071
Gain such that A - B K has eigenvalues given in p
7172
72-
Algorithm
73-
---------
74-
This is a wrapper function for scipy.signal.place_poles, which
75-
implements the Tits and Yang algorithm [1]. It will handle SISO,
76-
MISO, and MIMO systems. If you want more control over the algorithm,
77-
use scipy.signal.place_poles directly.
7873
79-
[1] A.L. Tits and Y. Yang, "Globally convergent algorithms for robust
80-
pole assignment by state feedback, IEEE Transactions on Automatic
81-
Control, Vol. 41, pp. 1432-1452, 1996.
74+
Notes
75+
-----
76+
Algorithm
77+
This is a wrapper function for :func:`scipy.signal.place_poles`, which
78+
implements the Tits and Yang algorithm [1]_. It will handle SISO,
79+
MISO, and MIMO systems. If you want more control over the algorithm,
80+
use :func:`scipy.signal.place_poles` directly.
8281
8382
Limitations
84-
-----------
85-
The algorithm will not place poles at the same location more
86-
than rank(B) times.
83+
The algorithm will not place poles at the same location more
84+
than rank(B) times.
85+
86+
References
87+
----------
88+
.. [1] A.L. Tits and Y. Yang, "Globally convergent algorithms for robust
89+
pole assignment by state feedback, IEEE Transactions on Automatic
90+
Control, Vol. 41, pp. 1432-1452, 1996.
8791
8892
Examples
8993
--------
@@ -228,10 +232,10 @@ def lqe(A, G, C, QN, RN, NN=None):
228232
systems. Given the system
229233
230234
.. math::
231-
235+
232236
x &= Ax + Bu + Gw \\\\
233237
y &= Cx + Du + v
234-
238+
235239
with unbiased process noise w and measurement noise v with covariances
236240
237241
.. math:: E{ww'} = QN, E{vv'} = RN, E{wv'} = NN
@@ -264,9 +268,10 @@ def lqe(A, G, C, QN, RN, NN=None):
264268
.. math::
265269
266270
A P + P A^T - (P C^T + G N) R^{-1} (C P + N^T G^T) + G Q G^T = 0
271+
267272
E: 1D array
268273
Eigenvalues of estimator poles eig(A - L C)
269-
274+
270275
271276
Examples
272277
--------
@@ -383,7 +388,7 @@ def lqr(*args, **keywords):
383388
See Also
384389
--------
385390
lqe
386-
391+
387392
"""
388393

389394
# Make sure that SLICOT is installed

control/statesp.py

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
_statesp_defaults = {
7373
'statesp.use_numpy_matrix': True,
7474
'statesp.default_dt': None,
75-
'statesp.remove_useless_states': True,
75+
'statesp.remove_useless_states': True,
7676
}
7777

7878

@@ -149,7 +149,7 @@ class StateSpace(LTI):
149149
Setting dt = 0 specifies a continuous system, while leaving dt = None
150150
means the system timebase is not specified. If 'dt' is set to True, the
151151
system will be treated as a discrete time system with unspecified sampling
152-
time. The default value of 'dt' is None and can be changed by changing the
152+
time. The default value of 'dt' is None and can be changed by changing the
153153
value of ``control.config.defaults['statesp.default_dt']``.
154154
155155
"""
@@ -788,15 +788,15 @@ def minreal(self, tol=0.0):
788788

789789
# TODO: add discrete time check
790790
def returnScipySignalLTI(self):
791-
"""Return a list of a list of scipy.signal.lti objects.
791+
"""Return a list of a list of :class:`scipy.signal.lti` objects.
792792
793793
For instance,
794794
795795
>>> out = ssobject.returnScipySignalLTI()
796796
>>> out[3][5]
797797
798-
is a signal.scipy.lti object corresponding to the transfer function from
799-
the 6th input to the 4th output."""
798+
is a :class:`scipy.signal.lti` object corresponding to the transfer
799+
function from the 6th input to the 4th output."""
800800

801801
# Preallocate the output.
802802
out = [[[] for _ in range(self.inputs)] for _ in range(self.outputs)]
@@ -809,8 +809,9 @@ def returnScipySignalLTI(self):
809809
return out
810810

811811
def append(self, other):
812-
"""Append a second model to the present model. The second
813-
model is converted to state-space if necessary, inputs and
812+
"""Append a second model to the present model.
813+
814+
The second model is converted to state-space if necessary, inputs and
814815
outputs are appended and their order is preserved"""
815816
if not isinstance(other, StateSpace):
816817
other = _convertToStateSpace(other)
@@ -870,8 +871,8 @@ def sample(self, Ts, method='zoh', alpha=None, prewarp_frequency=None):
870871
871872
prewarp_frequency : float within [0, infinity)
872873
The frequency [rad/s] at which to match with the input continuous-
873-
time system's magnitude and phase (the gain=1 crossover frequency,
874-
for example). Should only be specified with method='bilinear' or
874+
time system's magnitude and phase (the gain=1 crossover frequency,
875+
for example). Should only be specified with method='bilinear' or
875876
'gbt' with alpha=0.5 and ignored otherwise.
876877
877878
Returns
@@ -881,7 +882,7 @@ def sample(self, Ts, method='zoh', alpha=None, prewarp_frequency=None):
881882
882883
Notes
883884
-----
884-
Uses the command 'cont2discrete' from scipy.signal
885+
Uses :func:`scipy.signal.cont2discrete`
885886
886887
Examples
887888
--------
@@ -896,7 +897,7 @@ def sample(self, Ts, method='zoh', alpha=None, prewarp_frequency=None):
896897
if (method=='bilinear' or (method=='gbt' and alpha==0.5)) and \
897898
prewarp_frequency is not None:
898899
Twarp = 2*np.tan(prewarp_frequency*Ts/2)/prewarp_frequency
899-
else:
900+
else:
900901
Twarp = Ts
901902
Ad, Bd, C, D, _ = cont2discrete(sys, Twarp, method, alpha)
902903
return StateSpace(Ad, Bd, C, D, Ts)

control/xferfcn.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,8 @@ class TransferFunction(LTI):
9393
instance variable and setting it to something other than 'None'. If 'dt'
9494
has a non-zero value, then it must match whenever two transfer functions
9595
are combined. If 'dt' is set to True, the system will be treated as a
96-
discrete time system with unspecified sampling time. The default value of
97-
'dt' is None and can be changed by changing the value of
96+
discrete time system with unspecified sampling time. The default value of
97+
'dt' is None and can be changed by changing the value of
9898
``control.config.defaults['xferfcn.default_dt']``.
9999
100100
The TransferFunction class defines two constants ``s`` and ``z`` that
@@ -802,14 +802,14 @@ def minreal(self, tol=None):
802802
return TransferFunction(num, den, self.dt)
803803

804804
def returnScipySignalLTI(self):
805-
"""Return a list of a list of scipy.signal.lti objects.
805+
"""Return a list of a list of :class:`scipy.signal.lti` objects.
806806
807807
For instance,
808808
809809
>>> out = tfobject.returnScipySignalLTI()
810810
>>> out[3][5]
811811
812-
is a signal.scipy.lti object corresponding to the
812+
is a class:`scipy.signal.lti` object corresponding to the
813813
transfer function from the 6th input to the 4th output.
814814
815815
"""
@@ -1016,11 +1016,11 @@ def sample(self, Ts, method='zoh', alpha=None, prewarp_frequency=None):
10161016
The generalized bilinear transformation weighting parameter, which
10171017
should only be specified with method="gbt", and is ignored
10181018
otherwise.
1019-
1019+
10201020
prewarp_frequency : float within [0, infinity)
10211021
The frequency [rad/s] at which to match with the input continuous-
1022-
time system's magnitude and phase (the gain=1 crossover frequency,
1023-
for example). Should only be specified with method='bilinear' or
1022+
time system's magnitude and phase (the gain=1 crossover frequency,
1023+
for example). Should only be specified with method='bilinear' or
10241024
'gbt' with alpha=0.5 and ignored otherwise.
10251025
10261026
Returns
@@ -1032,7 +1032,7 @@ def sample(self, Ts, method='zoh', alpha=None, prewarp_frequency=None):
10321032
-----
10331033
1. Available only for SISO systems
10341034
1035-
2. Uses the command `cont2discrete` from `scipy.signal`
1035+
2. Uses :func:`scipy.signal.cont2discrete`
10361036
10371037
Examples
10381038
--------
@@ -1050,7 +1050,7 @@ def sample(self, Ts, method='zoh', alpha=None, prewarp_frequency=None):
10501050
if (method=='bilinear' or (method=='gbt' and alpha==0.5)) and \
10511051
prewarp_frequency is not None:
10521052
Twarp = 2*np.tan(prewarp_frequency*Ts/2)/prewarp_frequency
1053-
else:
1053+
else:
10541054
Twarp = Ts
10551055
numd, dend, _ = cont2discrete(sys, Twarp, method, alpha)
10561056
return TransferFunction(numd[0, :], dend, Ts)

doc/conf.py

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
# -- Project information -----------------------------------------------------
3131

3232
project = u'Python Control Systems Library'
33-
copyright = u'2019, python-control.org'
33+
copyright = u'2020, python-control.org'
3434
author = u'Python Control Developers'
3535

3636
# Version information - read from the source code
@@ -55,7 +55,7 @@
5555
# ones.
5656
extensions = [
5757
'sphinx.ext.autodoc', 'sphinx.ext.todo', 'sphinx.ext.napoleon',
58-
'sphinx.ext.intersphinx', 'sphinx.ext.imgmath',
58+
'sphinx.ext.intersphinx', 'sphinx.ext.imgmath',
5959
'sphinx.ext.autosummary', 'nbsphinx',
6060
]
6161

@@ -64,7 +64,8 @@
6464

6565
# list of autodoc directive flags that should be automatically applied
6666
# to all autodoc directives.
67-
autodoc_default_flags = ['members', 'inherited-members']
67+
autodoc_default_options = {'members': True,
68+
'inherited-members': True}
6869

6970
# Add any paths that contain templates here, relative to this directory.
7071
templates_path = ['_templates']
@@ -94,14 +95,14 @@
9495
# The name of the Pygments (syntax highlighting) style to use.
9596
pygments_style = 'sphinx'
9697

97-
#This config value contains the locations and names of other projects that
98-
#should be linked to in this documentation.
98+
# This config value contains the locations and names of other projects that
99+
# should be linked to in this documentation.
99100
intersphinx_mapping = \
100-
{'scipy':('https://docs.scipy.org/doc/scipy/reference', None),
101-
'numpy':('https://docs.scipy.org/doc/numpy', None)}
101+
{'scipy': ('https://docs.scipy.org/doc/scipy/reference', None),
102+
'numpy': ('https://docs.scipy.org/doc/numpy', None)}
102103

103-
#If this is True, todo and todolist produce output, else they produce nothing.
104-
#The default is False.
104+
# If this is True, todo and todolist produce output, else they produce nothing.
105+
# The default is False.
105106
todo_include_todos = True
106107

107108

@@ -189,8 +190,3 @@
189190
author, 'PythonControlLibrary', 'One line description of project.',
190191
'Miscellaneous'),
191192
]
192-
193-
194-
# -- Extension configuration -------------------------------------------------
195-
196-
# -- Options for intersphinx extension ---------------------------------------

0 commit comments

Comments
 (0)
0