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 — Enable scalar division of state-space objects by roryyorke · Pull Request #811 · python-control/python-control

Conversation

@roryyorke

@roryyorke roryyorke commented Dec 10, 2022

Copy link
Copy Markdown
Contributor

I think this is a reasonable if minor improvement; it lets one write gscaled = g / 2 instead of gscaled = g * (1/2). I'm less sure about division by arrays, but I see multiplication by arrays is allowed, and it seems natural to have symmetry between these operations.

I added a simple test for StateSpace / scalar and StateSpace / array, but not for InputOutputSystem / scalar. etc.

I also modified the type-conversion tests as required.

Sorry, something went wrong.

Uh oh!

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

All reactions
roryyorke added 2 commits December 10, 2022 11:59
@roryyorke
Allow division by scalar for StateSpace & InputOutputSystem
f81b6d2
Attempt division by any non-LTI and non-NameIOSystem by translating G
/ k to G * (1/k).

Division of StateSpace by TransferFunction, etc., unchanged.
@roryyorke
Remove __div__ and __rdiv__ methods
0efae63
These aren't used in Python 3.
@coveralls

coveralls commented Dec 10, 2022 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.05%) to 94.855% when pulling cc3fb2f on roryyorke:rory/ss-div-scalar into 9d65bf8 on python-control:main.

All reactions

Sorry, something went wrong.

Uh oh!

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

murrayrm
murrayrm reviewed Dec 11, 2022
View reviewed changes

@murrayrm murrayrm left a comment

Copy link
Copy Markdown
Member

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.

LGTM.

Sorry, something went wrong.

Uh oh!

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

All reactions
sawyerbfuller
sawyerbfuller reviewed Dec 12, 2022
View reviewed changes
Comment thread control/iosys.py Outdated
return newsys

def __truediv__(sys2, sys1):
"""Multiply two input/output systems (series interconnection)"""

@sawyerbfuller sawyerbfuller Dec 12, 2022

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.

should this docstring say "divide"?

Sorry, something went wrong.

Uh oh!

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

All reactions
sawyerbfuller
sawyerbfuller requested changes Dec 12, 2022
View reviewed changes

@sawyerbfuller sawyerbfuller 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.

looks good to me - with one possible update in a docstrong

Sorry, something went wrong.

Uh oh!

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

All reactions
@roryyorke

roryyorke commented Dec 13, 2022 via email

Copy link
Copy Markdown
Contributor Author
Whoops, yes. Should be similar to StateSpace truediv docstring. Earliest I can look at this is Friday.
…
On Mon, 12 Dec 2022, 18:55 Sawyer Fuller, ***@***.***> wrote: ***@***.**** commented on this pull request. ------------------------------ In control/iosys.py <#811 (comment)> : > @@ -346,6 +346,17 @@ def __neg__(sys): # Return the newly created system return newsys + def __truediv__(sys2, sys1): + """Multiply two input/output systems (series interconnection)""" should this docstring say "divide"? — Reply to this email directly, view it on GitHub <#811 (review)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AAA3C7TWMZLIXFWKP4YPHCDWM5KGRANCNFSM6AAAAAAS2FXV4E> . You are receiving this because you authored the thread.Message ID: ***@***.***>
All reactions

Sorry, something went wrong.

Uh oh!

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

@roryyorke
Update __truediv__ docstring for InputOutputSystem and StateSpace
cc3fb2f
@murrayrm
murrayrm merged commit 4b712a4 into python-control:main Dec 16, 2022
@murrayrm murrayrm added this to the 0.9.3 milestone Dec 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@murrayrm murrayrm murrayrm left review comments
@sawyerbfuller sawyerbfuller sawyerbfuller requested 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.3

Development

Successfully merging this pull request may close these issues.

Uh oh!

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

4 participants

@roryyorke @coveralls @murrayrm @sawyerbfuller
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.