10000 Merge pull request #297 from murrayrm/sphinx-fix-errors · Gonewithwind0/python-control@c0092e0 · GitHub
[go: up one dir, main page]

Skip to content

Commit c0092e0

Browse files
authored
Merge pull request python-control#297 from murrayrm/sphinx-fix-errors
Fix sphinx warnings and use readthedocs theme for local doc generation
2 parents 7943022 + 14566ef commit c0092e0

File tree

8 files changed

+63
-53
lines changed

8 files changed

+63
-53
lines changed

control/lti.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,9 @@ def isdtime(self, strict=False):
5454
5555
Parameters
5656
----------
57-
strict: bool (default = False)
58-
If strict is True, make sure that timebase is not None
57+
strict: bool, optional
58+
If strict is True, make sure that timebase is not None. Default
59+
is False.
5960
"""
6061

6162
# If no timebase is given, answer depends on strict flag
@@ -73,8 +74,9 @@ def isctime(self, strict=False):
7374
----------
7475
sys : LTI system
7576
System to be checked
76-
strict: bool (default = False)
77-
If strict is True, make sure that timebase is not None
77+
strict: bool, optional
78+
If strict is True, make sure that timebase is not None. Default
79+
is False.
7880
"""
7981
# If no timebase is given, answer depends on strict flag
8082
if self.dt is None:

control/modelsimp.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,9 +125,12 @@ def modred(sys, ELIM, method='matchdc'):
125125
Raises
126126
------
127127
ValueError
128-
- if `method` is not either ``'matchdc'`` or ``'truncate'``
129-
- if eigenvalues of `sys.A` are not all in left half plane
130-
(`sys` must be stable)
128+
Raised under the following conditions:
129+
130+
* if `method` is not either ``'matchdc'`` or ``'truncate'``
131+
132+
* if eigenvalues of `sys.A` are not all in left half plane
133+
(`sys` must be stable)
131134
132135
Examples
133136
--------

control/phaseplot.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ def phase_plot(odefun, X=None, Y=None, scale=1, X0=None, T=None,
118118
119119
See also
120120
--------
121-
box_grid(X, Y): construct box-shaped grid of initial conditions
121+
box_grid : construct box-shaped grid of initial conditions
122122
123123
Examples
124124
--------

control/statesp.py

Lines changed: 42 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -410,8 +410,7 @@ def horner(self, s):
410410

411411
# Method for generating the frequency response of the system
412412
def freqresp(self, omega):
413-
"""
414-
Evaluate the system's transfer func. at a list of freqs, omega.
413+
"""Evaluate the system's transfer func. at a list of freqs, omega.
415414
416415
mag, phase, omega = self.freqresp(omega)
417416
@@ -424,22 +423,25 @@ def freqresp(self, omega):
424423
425424
G(exp(j*omega*dt)) = mag*exp(j*phase).
426425
427-
Inputs
428-
------
429-
omega: A list of frequencies in radians/sec at which the system
430-
should be evaluated. The list can be either a python list
431-
or a numpy array and will be sorted before evaluation.
426+
Parameters
427+
----------
428+
omega : array
429+
A list of frequencies in radians/sec at which the system should be
430+
evaluated. The list can be either a python list or a numpy array
431+
and will be sorted before evaluation.
432432
433433
Returns
434434
-------
435-
mag: The magnitude (absolute value, not dB or log10) of the system
435+
mag : float
436+
The magnitude (absolute value, not dB or log10) of the system
436437
frequency response.
437438
438-
phase: The wrapped phase in radians of the system frequency
439-
response.
439+
phase : float
440+
The wrapped phase in radians of the system frequency response.
440441
441-
omega: The list of sorted frequencies at which the response
442-
was evaluated.
442+
omega : array
443+
The list of sorted frequencies at which the response was
444+
evaluated.
443445
444446
"""
445447

@@ -614,11 +616,11 @@ def lft(self, other, nu=-1, ny=-1):
614616
615617
Parameters
616618
----------
617-
other: LTI
619+
other : LTI
618620
The lower LTI system
619-
ny: int, optional
621+
ny : int, optional
620622
Dimension of (plant) measurement output.
621-
nu: int, optional
623+
nu : int, optional
622624
Dimension of (plant) control input.
623625
624626
"""
@@ -793,19 +795,21 @@ def sample(self, Ts, method='zoh', alpha=None):
793795
method : {"gbt", "bilinear", "euler", "backward_diff", "zoh"}
794796
Which method to use:
795797
796-
* gbt: generalized bilinear transformation
797-
* bilinear: Tustin's approximation ("gbt" with alpha=0.5)
798-
* euler: Euler (or forward differencing) method ("gbt" with alpha=0)
799-
* backward_diff: Backwards differencing ("gbt" with alpha=1.0)
800-
* zoh: zero-order hold (default)
798+
* gbt: generalized bilinear transformation
799+
* bilinear: Tustin's approximation ("gbt" with alpha=0.5)
800+
* euler: Euler (or forward differencing) method ("gbt" with
801+
alpha=0)
802+
* backward_diff: Backwards differencing ("gbt" with alpha=1.0)
803+
* zoh: zero-order hold (default)
801804
802805
alpha : float within [0, 1]
803806
The generalized bilinear transformation weighting parameter, which
804-
should only be specified with method="gbt", and is ignored otherwise
807+
should only be specified with method="gbt", and is ignored
808+
otherwise
805809
806810
Returns
807811
-------
808-
sysd : StateSpace system
812+
sysd : StateSpace
809813
Discrete time system, with sampling rate Ts
810814
811815
Notes
@@ -1079,18 +1083,18 @@ def _mimo2siso(sys, input, output, warn_conversion=False):
10791083
10801084
Parameters
10811085
----------
1082-
sys: StateSpace
1086+
sys : StateSpace
10831087
Linear (MIMO) system that should be converted.
1084-
input: int
1088+
input : int
10851089
Index of the input that will become the SISO system's only input.
1086-
output: int
1090+
output : int
10871091
Index of the output that will become the SISO system's only output.
1088-
warn_conversion: bool
1089-
If True: print a warning message when sys is a MIMO system.
1090-
Warn that a conversion will take place.
1092+
warn_conversion : bool, optional
1093+
If `True`, print a message when sys is a MIMO system,
1094+
warning that a conversion will take place. Default is False.
10911095
10921096
Returns
1093-
sys: StateSpace
1097+
sys : StateSpace
10941098
The converted (SISO) system.
10951099
"""
10961100
if not (isinstance(input, int) and isinstance(output, int)):
@@ -1341,16 +1345,16 @@ def rss(states=1, outputs=1, inputs=1):
13411345
13421346
Parameters
13431347
----------
1344-
states: integer
1348+
states : integer
13451349
Number of state variables
1346-
inputs: integer
1350+
inputs : integer
13471351
Number of system inputs
1348-
outputs: integer
1352+
outputs : integer
13491353
Number of system outputs
13501354
13511355
Returns
13521356
-------
1353-
sys: StateSpace
1357+
sys : StateSpace
13541358
The randomly created linear system
13551359
13561360
Raises
@@ -1379,16 +1383,16 @@ def drss(states=1, outputs=1, inputs=1):
13791383
13801384
Parameters
13811385
----------
1382-
states: integer
1386+
states : integer
13831387
Number of state variables
1384-
inputs: integer
1388+
inputs : integer
13851389
Number of system inputs
1386-
outputs: integer
1390+
outputs : integer
13871391
Number of system outputs
13881392
13891393
Returns
13901394
-------
1391-
sys: StateSpace
1395+
sys : StateSpace
13921396
The randomly created linear system
13931397
13941398
Raises
@@ -1417,7 +1421,7 @@ def ssdata(sys):
14171421
14181422
Parameters
14191423
----------
1420-
sys: LTI (StateSpace, or TransferFunction)
1424+
sys : LTI (StateSpace, or TransferFunction)
14211425
LTI system whose data will be returned
14221426
14231427
Returns

doc-requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
numpy
22
scipy
33
matplotlib
4+
sphinx_rtd_theme
45
numpydoc

doc/conf.py

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

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

3636
# Version information - read from the source code
3737
import re
3838
import control
3939

40-
# The short X.Y version
41-
version = re.sub(r'(\d+\.\d+)\.(.*)', r'\1', control.__version__)
40+
# The short X.Y.Z version
41+
version = re.sub(r'(\d+\.\d+\.\d+)(.*)', r'\1', control.__version__)
4242

4343
# The full version, including alpha/beta/rc tags
4444
release = control.__version__
@@ -109,7 +109,7 @@
109109
# The theme to use for HTML and HTML Help pages. See the documentation for
110110
# a list of builtin themes.
111111
#
112-
# html_theme = 'alabaster'
112+
html_theme = 'sphinx_rtd_theme'
113113

114114
# Theme options are theme-specific and customize the look and feel of a theme
115115
# further. For a list of options available for each theme, see the
@@ -120,7 +120,7 @@
120120
# Add any paths that contain custom static files (such as style sheets) here,
121121
# relative to this directory. They are copied after the builtin static files,
122122
# so a file named "default.css" will overwrite the builtin "default.css".
123-
html_static_path = ['_static']
123+
# html_static_path = ['_static']
124124

125125
# Custom sidebar templates, must be a dictionary that maps document names
126126
# to template names.

doc/control.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ System creation
1616

1717
ss
1818
tf
19-
FRD
19+
frd
2020
rss
2121
drss
2222

doc/intro.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Some differences from MATLAB
2323
The python-control package makes use of `NumPy <http://www.numpy.org>`_ and
2424
`SciPy <https://www.scipy.org>`_. A list of general differences between
2525
NumPy and MATLAB can be found `here
26-
<http://www.scipy.org/NumPy_for_Matlab_Users>`_.
26+
<https://docs.scipy.org/doc/numpy/user/numpy-for-matlab-users.html>`_.
2727

2828
In terms of the python-control package more specifically, here are
2929
some thing to keep in mind:

0 commit comments

Comments
 (0)
0