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 — Updated gram to support discrete-time systems by billtubbs · Pull Request #969 · python-control/python-control

Conversation

@billtubbs

@billtubbs billtubbs commented Feb 11, 2024

Copy link
Copy Markdown
Contributor

gram function for observability/controllability Gramians did not support discrete time systems, as described in #967 (comment).

Updated control/statefbk.py and tests in control/tests/statefbk_test.py.

Sorry, something went wrong.

Uh oh!

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

All reactions
@bnavigator

bnavigator commented Feb 18, 2024

Copy link
Copy Markdown
Contributor

I have fixed the failing FutureWarning test. Could you please rebase onto current main?

All reactions

Sorry, something went wrong.

Uh oh!

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

bnavigator
bnavigator reviewed Feb 18, 2024
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.

Thanks for working on these ancient TODO lines! They're 13 years old!

9b5b460

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread control/statefbk.py Outdated
raise ValueError("Oops, the system is unstable!")

else:
raise ValueError("sys")

@bnavigator bnavigator Feb 18, 2024 •
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.

I imagine an error message from this line could be very confusing.

Is this even reachable by normal API usage? If so, could you please cover it in statefbk_test.py? If not, do we really need the line or is a if sys.isctime(): .. else: ... construct enough?

Sorry, something went wrong.

Uh oh!

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

All reactions

@billtubbs billtubbs Feb 18, 2024

Copy link
Copy Markdown
Contributor Author

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.

This is true. The only time this would ever get raised is if someone passed an object that returns false to both isctime and isdtime. I put it in because it's bad practice to do if cond1: ... elif cond2: with no else but it would only realistically get raised during development if something was wrong. That's why I left the message very simple because no real user is likely to ever see it, hopefully!

Sorry, something went wrong.

Uh oh!

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

All reactions

@billtubbs billtubbs Feb 18, 2024 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Contributor Author

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.

If sys.isdtime literally returned not sys.isctime then we can be sure this will never occur. But it looks more complicated than that.

Still, this might be a case of 'belt and braces' (belt and suspenders) and I'm happy to delete it.

Sorry, something went wrong.

Uh oh!

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

All reactions

@bnavigator bnavigator Feb 18, 2024

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.

Okay, this may be pedantic but for the sake of coverage, please create a test so that the test suite at least hits that line once.

Sorry, something went wrong.

Uh oh!

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

All reactions
@billtubbs

billtubbs commented Feb 18, 2024

Copy link
Copy Markdown
Contributor Author

I have fixed the failing FutureWarning test. Could you please rebase onto current main?

Sorry, how do I do that again? I just tried using these instructions and not sure it worked.

All reactions

Sorry, something went wrong.

Uh oh!

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

@bnavigator

bnavigator commented Feb 18, 2024

Copy link
Copy Markdown
Contributor

Sorry, how do I do that again? I just tried using these instructions and not sure it worked.

Those instructions are not complete for your case. Your PR comes from basicmachines/main. That makes it a bit more complicated than our own instructions in https://github.com/python-control/python-control/wiki/How-to-contribute-with-a-pull-request

You need to:

option A

  1. Sync your fork on https://github.com/basicmachines/python-control-2/tree/main using the sync fork button
  2. Assuming your local machine has above repository as remote "origin":
git fetch origin
git rebase origin/main
git push -f

option B

# on branch main tracking basicmachines:main (https://github.com/basicmachines/python-control-2/tree/main)
git remote add upstreamhttps://github.com/python-control/python-control.git
git fetch upstream
git rebase upstream/main
git push -f

(Why do you have two forks? Better work with properly named feature branches)

All reactions

Sorry, something went wrong.

Uh oh!

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

@billtubbs

billtubbs commented Feb 18, 2024

Copy link
Copy Markdown
Contributor Author

(Why do you have two forks? Better work with properly named feature branches)

Sorry I probably shouldn't have created another fork. The previous fork has all that work I did on the plot functions previously (I shared a link to it with Richard in case he needs to refer to it). It's all far behind the origin now.

I'll fix that conditional statement so no test is needed and re-submit the PR.

All reactions

Sorry, something went wrong.

Uh oh!

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

@billtubbs

billtubbs commented Feb 18, 2024 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Contributor Author

I committed the change so it should be ready to merge now. I only ran the statefbk_test.py tests and there are still two fails but I don't think these are anything to do with the changes I made:

XFAIL control/tests/statefbk_test.py::TestStatefbk::testLQR_warning - warning not implemented
XFAIL control/tests/statefbk_test.py::TestStatefbk::testDLQR_warning - warning not implemented
All reactions

Sorry, something went wrong.

Uh oh!

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

@coveralls

coveralls commented Feb 18, 2024 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown

Coverage Status

coverage: 94.425% (+0.003%) from 94.422%
when pulling 0836ad8 on basicmachines:main
into 7a70be1 on python-control:main.

All reactions

Sorry, something went wrong.

Uh oh!

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

@bnavigator

bnavigator commented Feb 19, 2024

Copy link
Copy Markdown
Contributor

XFAIL

That is an "Expected fail" and nothing to worry about here.

All reactions

Sorry, something went wrong.

Uh oh!

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

@bnavigator

bnavigator commented Feb 19, 2024

Copy link
Copy Markdown
Contributor

You still need to rebase to current upstream/main (e1e33e4).

The current diff (https://github.com/python-control/python-control/pull/969/files) and commit list (https://github.com/python-control/python-control/pull/969/commits) shows changes from Henrik's and my merged PRs which we do not want to duplicate.

git switch main
git remote -v | grep 'upstream.*python-control/python-control' || git remote add upstream https://github.com/python-control/python-control.git
git fetch upstream
git rebase upstream/main
git push -f

image

All reactions

Sorry, something went wrong.

Uh oh!

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

@sawyerbfuller

sawyerbfuller commented Mar 25, 2024

Copy link
Copy Markdown
Contributor

@billtubbs if you're getting tied up doing a rebase (as has often happened to me) maybe easier would be to try working on a fresh branch from an up-to-date main and re-doing your changes by hand?

All reactions

Sorry, something went wrong.

Uh oh!

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

@billtubbs

billtubbs commented Mar 25, 2024

Copy link
Copy Markdown
Contributor Author

Hi Ben, Sawyer, sorry I got distracted and forgot to finish this. Thanks for the reminder I will get back to it this week.

All reactions

Sorry, something went wrong.

Uh oh!

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

@murrayrm

murrayrm commented Mar 30, 2024

Copy link
Copy Markdown
Member

@billtubbs I'm likely to release a new version of python-control in the next day or two. If you have a chance to rebase this PR, I'll include it in the v0.10.0 (otherwise v0.10.1).

All reactions

Sorry, something went wrong.

Uh oh!

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

billtubbs added 2 commits March 30, 2024 10:19
@billtubbs
Updated gram for dtime systems
2f982bb
@billtubbs
Removed redundant if condition
0836ad8
@billtubbs
billtubbs force-pushed the main branch from 888ff67 to 0836ad8 Compare March 30, 2024 17:19
@billtubbs

billtubbs commented Mar 30, 2024

Copy link
Copy Markdown
Contributor Author

Sorry for delay. I just rebased it using your earlier instructions and it seemed to work. Running the tests again now...

bnavigator 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.

@billtubbs

billtubbs commented Mar 30, 2024

Copy link
Copy Markdown
Contributor Author

Tests seemed to work. Is this success?

3550 passed, 30 skipped, 11 xfailed, 5 warnings in 133.34s (0:02:13)
bnavigator 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.

@murrayrm

murrayrm commented Mar 30, 2024

Copy link
Copy Markdown
Member

Thanks @billtubbs. The test output looks fine.

All reactions

Sorry, something went wrong.

Uh oh!

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

@murrayrm
murrayrm merged commit 4d878a9 into python-control:main Mar 30, 2024
@murrayrm murrayrm mentioned this pull request Mar 30, 2024
Observability Gramian for discrete-time systems #967
Closed
@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

Reviewers

@bnavigator bnavigator bnavigator left review comments

Uh oh!

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

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

0.10.0

Development

Successfully merging this pull request may close these issues.

Uh oh!

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

5 participants

@billtubbs @bnavigator @coveralls @sawyerbfuller @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.