GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — use __call__ instead of evalfr in lti system classes by sawyerbfuller · Pull Request #449 · python-control/python-control

Conversation

@sawyerbfuller

@sawyerbfuller sawyerbfuller commented Aug 14, 2020 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

fixes problem reported in #434 and extends #179.

  • move to __call__ as primary frequency response method to be used in TransferFunction, StateSpace, and FrequencyResponseData systems. (__call__ is new for StateSpace, and FrequencyResponse)
  • the new __call__ has same interface for all three classes, and can now take one or an array of s, unlike the old _evalfr, which could only take one s
  • it also adds a convenient keyword argument squeeze=True that automatically squeezes output if sys is SISO
  • for FrequencyResponseData.__call__(s), s must be purely imaginary or an error is raised
  • private method _evalfr that was inconsistent with matlab module matlab.evalfr was removed in favor of __call__
  • method sys.evalfr(s) has been deprecated for 2.5 years and is now removed. use __call__ instead, or matlab.evalfr(sys, s) (following discussion in lti.evalfr and sys._evalfr have different behavior #434)
  • method sys.freqresp(omega) is now deprecated. Use new pythonic methodsys.frequency_respose instead, or freqresp(sys, omega) from matlab module (following discussion in lti.evalfr and sys._evalfr have different behavior #434)
  • horner(s) now does the same thing for both TransferFunction and StateSpace systems: can evaluate at multiple values of s
  • de-duplication of code, cleanup, pythonization and vectorization of code where possible
  • FRD.eval behavior was left as-is, except for an optional squeeze argument

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@sawyerbfuller
eliminate _evalfr in lti system classes, replaced with __call__, whic…
1a6d806
…h evaluates at many frequencies at once
bnavigator
bnavigator reviewed Aug 14, 2020
View reviewed changes

@bnavigator bnavigator left a comment •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

There are a couple of failing unit tests to still iron out

May I point your interest towards #438, where some of the evalfr/_evalfr/freqresp etc. test have been treated by the iron already. Especially some continuous/discrete inconsistency.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread control/frdata.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

@sawyerbfuller

sawyerbfuller commented Aug 15, 2020

Copy link
Copy Markdown
Contributor Author

@bnavigator any idea how soon #438 will be ready for prime time? I can plan to try to merge (and figure out how to do that) when you’re done with the PR.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bnavigator

bnavigator commented Aug 15, 2020

Copy link
Copy Markdown
Contributor

Hi,

I think it is ready. But it depends on the yet unmerged PRs mentioned in the initial post. We should get those approved and merged first. I understand #438 is hard to review. The diff will get smaller with the underlying PRs though.

sawyerbfuller reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bnavigator bnavigator mentioned this pull request Aug 16, 2020
Refactor the test suite using pytest for array and matrix types #438
Merged
@sawyerbfuller
fixed remaining failing unit tests and cleanup of docfiles
b05492c
@sawyerbfuller sawyerbfuller changed the title [WIP] use __call__ instead of evalfr in lti system classes use __call__ instead of evalfr in lti system classes [done] Aug 16, 2020
@sawyerbfuller
minor fix following suggested change in frd str method
2c4ac62
@coveralls

coveralls commented Aug 16, 2020 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Coverage Status

Coverage decreased (-0.07%) to 87.438% when pulling a631098 on sawyerbfuller:call-method into 4103688 on python-control:master.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@coveralls

coveralls commented Aug 16, 2020

Copy link
Copy Markdown

Coverage Status

Coverage decreased (-0.2%) to 84.032% when pulling 2c4ac62 on sawyerbfuller:call-method into d3142ff on python-control:master.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@sawyerbfuller

sawyerbfuller commented Aug 16, 2020 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor Author

A few comments: sys.horner was modified slightly so that it only takes care of the low-level algorithm, while __call__ is intended to perform user friendly tasks like input formatting and squeezing the output as necessary.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@sawyerbfuller
fixed a few bugs that slipped through
6213a54
bnavigator
bnavigator reviewed Aug 16, 2020
View reviewed changes
Comment thread control/frdata.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

bnavigator
bnavigator requested changes Aug 16, 2020
View reviewed changes

@bnavigator bnavigator left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Please keep the numpydoc style

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread control/lti.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread control/margins.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread control/margins.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread control/statesp.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread control/statesp.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread control/statesp.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread control/statesp.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread control/statesp.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread control/xferfcn.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

bnavigator
bnavigator requested changes Aug 16, 2020
View reviewed changes

@bnavigator bnavigator left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

more numpydoc

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread control/frdata.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread control/frdata.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread control/lti.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread control/xferfcn.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

@bnavigator bnavigator added this to the 0.9.0 milestone Aug 16, 2020
@bnavigator bnavigator linked an issue Aug 16, 2020 that may be closed by this pull request
lti.evalfr and sys._evalfr have different behavior #434
Closed
@sawyerbfuller sawyerbfuller mentioned this pull request Aug 17, 2020
proposal to standardize squeezing output from systems #453
Closed
sawyerbfuller and others added 10 commits August 17, 2020 10:49
@sawyerbfuller @bnavigator
Update control/frdata.py
8486b7a
Co-authored-by: Ben Greiner <[email protected]>
@sawyerbfuller @bnavigator
Update control/frdata.py
c8bf92f
Co-authored-by: Ben Greiner <[email protected]>
@sawyerbfuller @bnavigator
Update control/lti.py
371986c
doc fix

Co-authored-by: Ben Greiner <[email protected]>
@sawyerbfuller @bnavigator
Update control/statesp.py
d8fbaa0
suggested doctoring fix for statesspace.slycot_horner

Co-authored-by: Ben Greiner <[email protected]>
@sawyerbfuller @bnavigator
Apply suggestions from code review
17bc2a8
doctoring fixes to adhere to numpydoc convention

Co-authored-by: Ben Greiner <[email protected]>
@sawyerbfuller
suggested changes in docstrings
4ad33db
@sawyerbfuller
Merge remote-tracking branch 'origin/call-method' into call-method
94322c8
@sawyerbfuller
better docstrings conforming to numpydoc
60433e0
@sawyerbfuller
converted statesp.horner to take care of trying to use slycot_horner …
262fde6
…and doing fallback
@sawyerbfuller
renamed slycot_horner to slycot_laub
4c3ed0b
@sawyerbfuller

sawyerbfuller commented Aug 17, 2020

Copy link
Copy Markdown
Contributor Author

most recent commit moves the task of calling slycot and fall-back if it doesn't work into sys.horner

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@sawyerbfuller
docs more consistent
b37c16b
sawyerbfuller
sawyerbfuller commented Jan 7, 2021
View reviewed changes
Comment thread control/lti.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

sawyerbfuller
sawyerbfuller commented Jan 7, 2021
View reviewed changes
Comment thread control/lti.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

sawyerbfuller
sawyerbfuller commented Jan 7, 2021
View reviewed changes
Comment thread control/lti.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

sawyerbfuller
sawyerbfuller commented Jan 7, 2021
View reviewed changes
Comment thread control/lti.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

sawyerbfuller
sawyerbfuller commented Jan 7, 2021
View reviewed changes
Comment thread control/lti.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

sawyerbfuller
sawyerbfuller commented Jan 7, 2021
View reviewed changes
Comment thread control/frdata.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

sawyerbfuller
sawyerbfuller commented Jan 7, 2021
View reviewed changes
Comment thread control/frdata.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

sawyerbfuller
sawyerbfuller commented Jan 7, 2021
View reviewed changes
Comment thread control/lti.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

sawyerbfuller
sawyerbfuller commented Jan 7, 2021
View reviewed changes
Comment thread control/lti.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

sawyerbfuller
sawyerbfuller commented Jan 7, 2021
View reviewed changes
Comment thread control/lti.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

sawyerbfuller
sawyerbfuller commented Jan 7, 2021
View reviewed changes
Comment thread control/lti.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

sawyerbfuller
sawyerbfuller commented Jan 7, 2021
View reviewed changes
Comment thread control/lti.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

sawyerbfuller
sawyerbfuller commented Jan 7, 2021
View reviewed changes
Comment thread control/lti.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

sawyerbfuller
sawyerbfuller commented Jan 7, 2021
View reviewed changes
Comment thread control/lti.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

sawyerbfuller
sawyerbfuller commented Jan 7, 2021
View reviewed changes
Comment thread control/lti.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

sawyerbfuller
sawyerbfuller commented Jan 7, 2021
View reviewed changes
Comment thread control/statesp.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

sawyerbfuller
sawyerbfuller commented Jan 7, 2021
View reviewed changes
Comment thread control/statesp.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

sawyerbfuller
sawyerbfuller commented Jan 7, 2021
View reviewed changes
Comment thread control/statesp.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

sawyerbfuller
sawyerbfuller commented Jan 7, 2021
View reviewed changes
Comment thread control/statesp.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

@sawyerbfuller @bnavigator
doc updates to specify frequency response outputs more precisely
178bfa0
Co-authored-by: Ben Greiner <[email protected]>
sawyerbfuller
sawyerbfuller commented Jan 7, 2021
View reviewed changes
Comment thread control/xferfcn.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

sawyerbfuller
sawyerbfuller commented Jan 7, 2021
View reviewed changes
Comment thread control/xferfcn.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

sawyerbfuller
sawyerbfuller commented Jan 7, 2021
View reviewed changes
Comment thread control/xferfcn.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

sawyerbfuller
sawyerbfuller commented Jan 7, 2021
View reviewed changes
Comment thread control/xferfcn.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

@sawyerbfuller @bnavigator
missed a couple of doc updates in xferfcn
a631098
Co-authored-by: Ben Greiner <[email protected]>
@sawyerbfuller

sawyerbfuller commented Jan 7, 2021 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor Author

ok I think ive resolved doc comments with the last two commits

Travis isnt happy about somethng though.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bnavigator

bnavigator commented Jan 7, 2021

Copy link
Copy Markdown
Contributor

Build 940 and 941 got canceled and 942 didn't start yet. We have to wait a little.

And the day when we can ditch Travis for a different CI will be a happy day for me. (Working on Github Actions for Slycot right now in python-control/Slycot#140, and then I will tackle #446)

sawyerbfuller reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@sawyerbfuller

sawyerbfuller commented Jan 8, 2021

Copy link
Copy Markdown
Contributor Author

Ok looks like Travis is happy now. I’m happy to have it merged but don’t understand the various options, happy to leave it to @murrayrm and @bnavigator discretion.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@murrayrm
murrayrm merged commit 0eb4396 into python-control:master Jan 8, 2021
@murrayrm murrayrm mentioned this pull request Mar 15, 2021
control.matlab.freqresp is inconsistent with MATLAB #573
Open
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@bnavigator bnavigator bnavigator approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

0.9.0

Development

Successfully merging this pull request may close these issues.

lti.evalfr and sys._evalfr have different behavior

Uh oh!

There was an error while loading. Please reload this page.

5 participants

@sawyerbfuller @bnavigator @coveralls @roryyorke @murrayrm
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.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.