Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Version 0.10.2 release notes #1140

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Jul 4, 2025
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
20 changes: 19 additions & 1 deletion control/iosys.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,24 @@ class NamedSignal(np.ndarray):
This class modifies the `numpy.ndarray` class and allows signals to
be accessed using the signal name in addition to indices and slices.

Signals can be either a 2D array, index by signal and time, or a 3D
array, indexed by signal, trace, and time.

Attributes
----------
signal_labels : list of str
Label names for each of the signal elements in the signal.
trace_labels : list of str, optional
Label names for each of the traces in the signal (if multi-trace).

Examples
--------
>>> sys = ct.rss(
... states=['p1', 'p2', 'p3'], inputs=['u1', 'u2'], outputs=['y'])
>>> resp = ct.step_response(sys)
>>> resp.states['p1', 'u1'] # Step response from u1 to p1
NamedSignal(...)

"""
def __new__(cls, input_array, signal_labels=None, trace_labels=None):
# See https://numpy.org/doc/stable/user/basics.subclassing.html
Expand Down Expand Up @@ -314,7 +332,7 @@ def _repr_latex_(self):
def _repr_html_(self):
# Defaults to using __repr__; override in subclasses
return None

def _repr_markdown_(self):
return self._repr_html_()

Expand Down
8 changes: 3 additions & 5 deletions control/tests/phaseplot_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ def invpend_ode(t, x, m=0, l=0, b=0, g=0):
ct.phase_plane_plot(
invpend_ode, [-5, 5, 2, 2], params={'stuff': (1, 1, 0.2, 1)},
plot_streamlines=True)

with pytest.raises(ValueError, match="gridtype must be 'meshgrid' when using streamplot"):
ct.phase_plane_plot(ct.rss(2, 1, 1), plot_streamlines=False,
plot_streamplot=True, gridtype='boxgrid')
Expand All @@ -190,7 +190,7 @@ def invpend_ode(t, x, m=0, l=0, b=0, g=0):
sys, [-12, 12, -10, 10], 15, gridspec=[2, 9],
plot_streamlines=True, plot_separatrices=False,
suppress_warnings=True)

@pytest.mark.usefixtures('mplcleanup')
def test_phase_plot_zorder():
# some of these tests are a bit akward since the streamlines and separatrices
Expand All @@ -211,7 +211,7 @@ def get_zorders(cplt):
assert cplt.lines[3] == None or isinstance(cplt.lines[3], mpl.streamplot.StreamplotSet)
streamplot = max(cplt.lines[3].lines.get_zorder(), cplt.lines[3].arrows.get_zorder()) if cplt.lines[3] else None
return streamlines, quiver, streamplot, separatrices, equilpoints

def assert_orders(streamlines, quiver, streamplot, separatrices, equilpoints):
print(streamlines, quiver, streamplot, separatrices, equilpoints)
if streamlines is not None:
Expand Down Expand Up @@ -261,8 +261,6 @@ def sys(t, x):
# make sure changing the norm at least doesn't throw an error
ct.phase_plane_plot(sys, plot_streamplot=dict(vary_color=True, norm=mpl.colors.LogNorm()))




@pytest.mark.usefixtures('mplcleanup')
def test_basic_phase_plots(savefigs=False):
Expand Down
14 changes: 7 additions & 7 deletions control/timeresp.py
Original file line number Diff line number Diff line change
Expand Up @@ -551,10 +551,10 @@ def outputs(self):
def states(self):
"""Time response state vector.

Time evolution of the state vector, indexed indexed by either the
state and time (if only a single trace is given) or the state, trace,
and time (for multiple traces). See `TimeResponseData.squeeze`
for a description of how this can be modified using the `squeeze`
Time evolution of the state vector, indexed by either the state and
time (if only a single trace is given) or the state, trace, and
time (for multiple traces). See `TimeResponseData.squeeze` for a
description of how this can be modified using the `squeeze`
keyword.

Input and output signal names can be used to index the data in
Expand Down Expand Up @@ -616,9 +616,9 @@ def inputs(self):
def _legacy_states(self):
"""Time response state vector (legacy version).

Time evolution of the state vector, indexed indexed by either the
state and time (if only a single trace is given) or the state,
trace, and time (for multiple traces).
Time evolution of the state vector, indexed by either the state and
time (if only a single trace is given) or the state, trace, and
time (for multiple traces).

The `legacy_states` property is not affected by the `squeeze` keyword
and hence it will always have these dimensions.
Expand Down
2 changes: 1 addition & 1 deletion doc/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Makefile for python-control Sphinx documentation
# RMM, 15 Jan 2025

FIGS = figures/classes.pdf
FIGS = figures/classes.svg
RST_FIGS = figures/flatsys-steering-compare.png \
figures/iosys-predprey-open.png \
figures/timeplot-servomech-combined.png \
Expand Down
9 changes: 9 additions & 0 deletions doc/_templates/extended-class-template.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{{ fullname | escape | underline}}

.. currentmodule:: {{ module }}

.. autoclass:: {{ objname }}
:no-members:
:show-inheritance:
:no-inherited-members:
:no-special-members:
19 changes: 15 additions & 4 deletions doc/classes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ systems (both linear time-invariant and nonlinear). They are usually
created from factory functions such as :func:`tf` and :func:`ss`, so the
user should normally not need to instantiate these directly.

The following figure illustrates the relationship between the classes.
The following figure illustrates the relationship between the classes:

.. image:: figures/classes.pdf
:width: 800
.. figure:: figures/classes.svg
:width: 640
:align: center

.. autosummary::
Expand All @@ -34,6 +34,17 @@ The following figure illustrates the relationship between the classes.
InterconnectedSystem
LinearICSystem

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

.. autosummary::
:toctree: generated/
:template: extended-class-template.rst
:nosignatures:

NamedSignal


Response and Plotting Classes
=============================
Expand Down Expand Up @@ -95,5 +106,5 @@ operations:
optimal.OptimalEstimationProblem
optimal.OptimalEstimationResult

More informaton on the functions used to create these classes can be
More information on the functions used to create these classes can be
found in the :ref:`nonlinear-systems` chapter.
6 changes: 3 additions & 3 deletions doc/figures/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# RMM, 26 Dec 2024

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

# Location of the control package
SRCDIR = ../..
Expand All @@ -12,5 +12,5 @@ all: $(FIGS)
clean:
/bin/rm -f $(FIGS)

classes.pdf: classes.fig
fig2dev -Lpdf $< $@
classes.svg: classes.fig
fig2dev -Lsvg $< $@
22 changes: 12 additions & 10 deletions doc/figures/classes.fig
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#FIG 3.2 Produced by xfig version 3.2.8b
#FIG 3.2 Produced by xfig version 3.2.9
#encoding: UTF-8
Landscape
Center
Inches
Expand Down Expand Up @@ -37,12 +38,13 @@ Single
2 1 0 2 1 7 50 -1 -1 0.000 0 0 7 0 1 2
1 0 1.00 60.00 90.00
6525 1950 7050 2550
4 1 1 50 -1 16 12 0.0000 4 210 2115 4050 3675 InterconnectedSystem\001
4 1 1 50 -1 16 12 0.0000 4 165 1605 7950 3675 TransferFunction\001
4 1 1 50 -1 0 12 0.0000 4 150 345 7050 2775 LTI\001
4 1 1 50 -1 16 12 0.0000 4 210 1830 5175 2775 NonlinearIOSystem\001
4 1 1 50 -1 16 12 0.0000 4 210 1095 6150 3675 StateSpace\001
4 1 1 50 -1 16 12 0.0000 4 210 1500 5175 4575 LinearICSystem\001
4 2 1 50 -1 16 12 0.0000 4 210 1035 3375 3225 FlatSystem\001
4 0 1 50 -1 16 12 0.0000 4 165 420 8400 3225 FRD\001
4 1 1 50 -1 16 12 0.0000 4 210 1770 6300 1875 InputOutputSystem\001
4 1 1 50 -1 16 12 0.0000 4 191 1958 4050 3675 InterconnectedSystem\001
4 1 1 50 -1 16 12 0.0000 4 151 1496 7950 3675 TransferFunction\001
4 1 1 50 -1 0 12 0.0000 4 133 305 7050 2775 LTI\001
4 1 1 50 -1 16 12 0.0000 4 191 1705 5175 2775 NonlinearIOSystem\001
4 1 1 50 -1 16 12 0.0000 4 190 1016 6150 3675 StateSpace\001
4 1 1 50 -1 16 12 0.0000 4 191 1394 5175 4575 LinearICSystem\001
4 2 1 50 -1 16 12 0.0000 4 191 970 3375 3225 FlatSystem\001
4 0 1 50 -1 16 12 0.0000 4 145 384 8400 3225 FRD\001
4 1 1 50 -1 16 12 0.0000 4 191 1681 6300 1875 InputOutputSystem\001
4 1 7 50 -1 16 12 0.0000 4 22 21 5175 4800 .\001
Binary file removed doc/figures/classes.pdf
Binary file not shown.
151 changes: 151 additions & 0 deletions doc/figures/classes.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions doc/linear.rst
Original file line number Diff line number Diff line change
Expand Up @@ -531,6 +531,8 @@ equilibrium values (thereby keeping the input/output gain unchanged at
zero frequency ["DC"]).


.. _displaying-lti-system-information:

Displaying LTI System Information
=================================

Expand Down
2 changes: 1 addition & 1 deletion doc/phaseplot.rst
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ on a grid, equilibrium points and separatrices if they exist. A variety
of options are available to modify the information that is plotted,
including plotting a grid of vectors instead of streamlines, plotting
streamlines from arbitrary starting points and turning on and off
various features of the plot.
various features of the plot.

To illustrate some of these possibilities, consider a phase plane plot for
an inverted pendulum system, which is created using a mesh grid:
Expand Down
1 change: 1 addition & 0 deletions doc/releases.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ the ability to index systems and signal using signal labels.
.. toctree::
:maxdepth: 1

releases/0.10.2-notes
releases/0.10.1-notes
releases/0.10.0-notes

Expand Down
4 changes: 2 additions & 2 deletions doc/releases/0.10.1-notes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

.. _version-0.10.1:

Version 0.10.1 Release Notes (current)
--------------------------------------
Version 0.10.1 Release Notes
----------------------------

* Released: 17 Aug 2024
* `GitHub release page
Expand Down
Loading
Loading