Skip to content

Commit 9d33e1f

Browse files
committed
address @slivingston review + other small fixes, cleanup
1 parent 7548738 commit 9d33e1f

12 files changed

+186
-36
lines changed

control/iosys.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ def _repr_latex_(self):
332332
def _repr_html_(self):
333333
# Defaults to using __repr__; override in subclasses
334334
return None
335-
335+
336336
def _repr_markdown_(self):
337337
return self._repr_html_()
338338

control/tests/phaseplot_test.py

+3-5
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ def invpend_ode(t, x, m=0, l=0, b=0, g=0):
167167
ct.phase_plane_plot(
168168
invpend_ode, [-5, 5, 2, 2], params={'stuff': (1, 1, 0.2, 1)},
169169
plot_streamlines=True)
170-
170+
171171
with pytest.raises(ValueError, match="gridtype must be 'meshgrid' when using streamplot"):
172172
ct.phase_plane_plot(ct.rss(2, 1, 1), plot_streamlines=False,
173173
plot_streamplot=True, gridtype='boxgrid')
@@ -190,7 +190,7 @@ def invpend_ode(t, x, m=0, l=0, b=0, g=0):
190190
sys, [-12, 12, -10, 10], 15, gridspec=[2, 9],
191191
plot_streamlines=True, plot_separatrices=False,
192192
suppress_warnings=True)
193-
193+
194194
@pytest.mark.usefixtures('mplcleanup')
195195
def test_phase_plot_zorder():
196196
# some of these tests are a bit akward since the streamlines and separatrices
@@ -211,7 +211,7 @@ def get_zorders(cplt):
211211
assert cplt.lines[3] == None or isinstance(cplt.lines[3], mpl.streamplot.StreamplotSet)
212212
streamplot = max(cplt.lines[3].lines.get_zorder(), cplt.lines[3].arrows.get_zorder()) if cplt.lines[3] else None
213213
return streamlines, quiver, streamplot, separatrices, equilpoints
214-
214+
215215
def assert_orders(streamlines, quiver, streamplot, separatrices, equilpoints):
216216
print(streamlines, quiver, streamplot, separatrices, equilpoints)
217217
if streamlines is not None:
@@ -261,8 +261,6 @@ def sys(t, x):
261261
# make sure changing the norm at least doesn't throw an error
262262
ct.phase_plane_plot(sys, plot_streamplot=dict(vary_color=True, norm=mpl.colors.LogNorm()))
263263

264-
265-
266264

267265
@pytest.mark.usefixtures('mplcleanup')
268266
def test_basic_phase_plots(savefigs=False):

control/timeresp.py

+7-7
Original file line numberDiff line numberDiff line change
@@ -551,10 +551,10 @@ def outputs(self):
551551
def states(self):
552552
"""Time response state vector.
553553
554-
Time evolution of the state vector, indexed indexed by either the
555-
state and time (if only a single trace is given) or the state, trace,
556-
and time (for multiple traces). See `TimeResponseData.squeeze`
557-
for a description of how this can be modified using the `squeeze`
554+
Time evolution of the state vector, indexed by either the state and
555+
time (if only a single trace is given) or the state, trace, and
556+
time (for multiple traces). See `TimeResponseData.squeeze` for a
557+
description of how this can be modified using the `squeeze`
558558
keyword.
559559
560560
Input and output signal names can be used to index the data in
@@ -616,9 +616,9 @@ def inputs(self):
616616
def _legacy_states(self):
617617
"""Time response state vector (legacy version).
618618
619-
Time evolution of the state vector, indexed indexed by either the
620-
state and time (if only a single trace is given) or the state,
621-
trace, and time (for multiple traces).
619+
Time evolution of the state vector, indexed by either the state and
620+
time (if only a single trace is given) or the state, trace, and
621+
time (for multiple traces).
622622
623623
The `legacy_states` property is not affected by the `squeeze` keyword
624624
and hence it will always have these dimensions.

doc/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Makefile for python-control Sphinx documentation
22
# RMM, 15 Jan 2025
33

4-
FIGS = figures/classes.pdf
4+
FIGS = figures/classes.svg
55
RST_FIGS = figures/flatsys-steering-compare.png \
66
figures/iosys-predprey-open.png \
77
figures/timeplot-servomech-combined.png \

doc/classes.rst

+4-4
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ user should normally not need to instantiate these directly.
1616

1717
The following figure illustrates the relationship between the classes:
1818

19-
.. figure:: figures/classes.pdf
20-
:width: 480
19+
.. figure:: figures/classes.svg
20+
:width: 640
2121
:align: center
2222

2323
.. autosummary::
@@ -36,7 +36,7 @@ The following figure illustrates the relationship between the classes:
3636

3737
The time response of an input/output system is represented using a
3838
special :class:`NamedSignal` class that allows the individual signal
39-
elements to be access using signal names in palce of integer offsets:
39+
elements to be access using signal names in place of integer offsets:
4040

4141
.. autosummary::
4242
:toctree: generated/
@@ -106,5 +106,5 @@ operations:
106106
optimal.OptimalEstimationProblem
107107
optimal.OptimalEstimationResult
108108

109-
More informaton on the functions used to create these classes can be
109+
More information on the functions used to create these classes can be
110110
found in the :ref:`nonlinear-systems` chapter.

doc/figures/Makefile

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# RMM, 26 Dec 2024
33

44
# List of figures that need to be created (first figure generated is OK)
5-
FIGS = classes.pdf
5+
FIGS = classes.svg
66

77
# Location of the control package
88
SRCDIR = ../..
@@ -12,5 +12,5 @@ all: $(FIGS)
1212
clean:
1313
/bin/rm -f $(FIGS)
1414

15-
classes.pdf: classes.fig
16-
fig2dev -Lpdf $< $@
15+
classes.svg: classes.fig
16+
fig2dev -Lsvg $< $@

doc/figures/classes.pdf

-6.91 KB
Binary file not shown.

doc/figures/classes.svg

+151
Loading

doc/phaseplot.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ on a grid, equilibrium points and separatrices if they exist. A variety
4343
of options are available to modify the information that is plotted,
4444
including plotting a grid of vectors instead of streamlines, plotting
4545
streamlines from arbitrary starting points and turning on and off
46-
various features of the plot.
46+
various features of the plot.
4747

4848
To illustrate some of these possibilities, consider a phase plane plot for
4949
an inverted pendulum system, which is created using a mesh grid:

doc/releases/0.10.1-notes.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
.. _version-0.10.1:
44

5-
Version 0.10.1 Release Notes (current)
6-
--------------------------------------
5+
Version 0.10.1 Release Notes
6+
----------------------------
77

88
* Released: 17 Aug 2024
99
* `GitHub release page

doc/releases/0.10.2-notes.rst

+12-11
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
.. _version-0.10.2:
44

5-
Version 0.10.2 Release Notes
6-
----------------------------
5+
Version 0.10.2 Release Notes (current)
6+
--------------------------------------
77

88
* Released: date of release
99
* `GitHub release page
@@ -59,7 +59,7 @@ The following bugs have been fixed in this release:
5959
`cplt.lines`.
6060

6161
* Processing of the timebase parameter (`dt`) for I/O systems is now
62-
handled uniformly across all I/O system factor functions. This
62+
handled uniformly across all I/O system factory functions. This
6363
affected the `zpk` function, which was defaulting to a discrete time
6464
system to have timebase None instead of 0.
6565

@@ -104,15 +104,15 @@ were implemented in this release:
104104
* User documentation is now divided into a User Guide that provides a
105105
description of the main functionality of the python-control package,
106106
along with a Reference Manual describing classes, functions, and
107-
parameter in more detail.
107+
parameters in more detail.
108108

109109
* Signal responses and I/O subsystem specifications can now use signal
110110
names in addition to indices to get the desired inputs, outputs, and
111111
states (e.g., `response.outputs['y0', 'y1']`). This is implemented
112112
via a new `NamedSignal` object, which generalizes `numpy.ndarray`.
113-
113+
114114
* `find_operating_point` (legacy `find_eqpt`): accepts new parameters
115-
`root_method` and `root_keyword` to set the root finding algorithm
115+
`root_method` and `root_kwargs` to set the root finding algorithm
116116
that is used.
117117

118118
* `root_locus_map` now correctly handles the degenerate case of being
@@ -131,7 +131,7 @@ were implemented in this release:
131131
functions to be given as a means of creating a MIMO transfer
132132
function (use the new `combine_tf` function).
133133

134-
* The `nlsys` factor function can now create a `NonlinearIOSystem`
134+
* The `nlsys` factory function can now create a `NonlinearIOSystem`
135135
representation of a `StateSpace` system (passed as the first
136136
argument to `nlsys`).
137137

@@ -168,8 +168,9 @@ were implemented in this release:
168168
* `FrequencyResponseData`: use `~FrequencyResponseData.complex` to
169169
access the (squeeze processed) complex frequency response (instead
170170
of the legacy `response` property) and
171-
`~FrequencyResponseData.frdata` to access the 3D frequency response
172-
data array (instead of the legacy `fresp` attribute).
171+
`~FrequencyResponseData.frdata <FrequencyResponseData>` to access
172+
the 3D frequency response data array (instead of the legacy `fresp`
173+
attribute).
173174

174175
* Time response and optimization function keywords have been
175176
regularized to allow consistent use of keywords across related
@@ -182,7 +183,7 @@ were implemented in this release:
182183
- Variables associated with inputs, outputs, states and time use
183184
those words plus an appropriate modifier: `initial_state`,
184185
`final_output`, `input_indices`, etc.
185-
186+
186187
- Aliases are used both to maintain backward compatibility and to
187188
allow shorthand descriptions: e.g., `U`, `Y`, `X0`. Short form
188189
aliases are documented in docstrings by listing the parameter as
@@ -207,7 +208,7 @@ generate a warning message when used:
207208
* `FrequencyResponseData.response`: use
208209
`FrequencyResponseData.complex` to return the complex value of the
209210
frequency response.
210-
211+
211212
* `FrequencyResponseData.fresp`: use `FrequencyResponseData.frdata
212213
<FrequencyResponseData>` to access the raw 3D frequency response
213214
data array.

doc/requirements.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ sphinx-copybutton
77
numpydoc
88
ipykernel
99
nbsphinx
10-
docutils==0.16 # pin until sphinx_rtd_theme is compatible with 0.17 or later
10+
docutils

0 commit comments

Comments
 (0)