Skip to content

Add unit test illustrating issue #935 + add method keyword for tf2ss #937

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 3 commits into from
Nov 8, 2023

Conversation

murrayrm
Copy link
Member

This PR puts in some unit tests associated with issue #935, which looks like it is a problem in slycot where the tf2ss functionality (in td04ad) doesn't work properly. As a partial workaround, a method keyword is added to tf2ss (and ss) that allows method='scipy' to be used for SISO systems. Docstrings updated for the new keyword and a note on the slycot issue.

A bug report has been created in the slycot repository (#222 and the unit tests will fail when the bug is fixed (so we can go back and update the unit tests and documentation).

@murrayrm murrayrm linked an issue Oct 22, 2023 that may be closed by this pull request
@coveralls
Copy link

coveralls commented Oct 22, 2023

Coverage Status

coverage: 95.003%. first build
when pulling 31793e6 on murrayrm:tf2ss_unstable_bug-21Oct2023
into a44def1 on python-control:main.

@@ -2250,6 +2274,8 @@ def _convert_to_statespace(sys, use_prefix_suffix=False):
A, B, C, D = \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change for the two lines above:

if not issiso(sys):
    raise ControlMIMONotImplemented("MIMO system conversion not supported without Slycot")

@@ -2250,6 +2274,8 @@ def _convert_to_statespace(sys, use_prefix_suffix=False):
A, B, C, D = \
sp.signal.tf2ss(squeeze(sys.num), squeeze(sys.den))
newsys = StateSpace(A, B, C, D, sys.dt)
else:
raise ValueError(f"unknown {method=}")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First instantiation of self-documenting F-strings in python-control? : )

@murrayrm murrayrm merged commit 2ddc9ea into python-control:main Nov 8, 2023
@murrayrm murrayrm deleted the tf2ss_unstable_bug-21Oct2023 branch November 8, 2023 06:39
@murrayrm murrayrm added this to the 0.10.0 milestone Mar 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants