Lint fixes on benchmarks and examples/*.py #1135
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I don't think these are too controversial.
CI failures
I see two failures on CI , but I can't see that these changes caused them:
first, in
doctest-linux
: https://github.com/roryyorke/python-control/actions/runs/13612156165/job/38050709282which seems to be sphinx-doc/sphinx#13352.
Then in
install-examples
: https://github.com/roryyorke/python-control/actions/runs/13612156159/job/38050709274I'll install jupyterlab in my dev environment and see if I can reproduce this. I can't see that changing *.py files in examples could cause this.
tfvis.py and
PwmPmwWhen I ran
tfvis.py
under Python 3.12, I gotin
PwmPmw code.Callable
was moved tocollections.abc
in Python 3.10 (October 2021). The hack below lets the script run, but unlesspwmPmw is updated we should consider retiring this example.Warnings in examples
Some examples raise control deprecation warnings, e.g.,
genswitch.py
usesphase_plot
instead ofphase_plane_plot
. I started looking into this, but it got a bit involved.Lint on notebooks
ruff
can also run on Jupyter notebooks. Some fixes are obvious:but I'm less sure about changing these
*
imports; they are convenient, and make things more familiar for Matlab users: