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 examples to be PEP compliant by billtubbs · Pull Request #307 · python-control/python-control

Conversation

@billtubbs

@billtubbs billtubbs commented Jun 8, 2019 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Contributor

Made various edits to all the example scripts including:

  • Replaced Python 2.7 print statements with print(...)
  • Removed MATLAB-like formatting such as semi-colons
  • Changed indenting and syntax to be PEP compliant (using PyCharm)
  • Changed imports from from ___ import * to conventions such as import matplotlib.pyplot as plt and import numpy as np
  • Removed tabs
  • Added the following line to scripts that produce plot output:
if 'PYCONTROL_TEST_EXAMPLES' not in os.environ:
    plt.show()

Outstanding issues:

  • Some examples still use out-dated np.matrix

Sorry, something went wrong.

Uh oh!

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

All reactions
billtubbs added 4 commits May 18, 2019 23:48
@billtubbs
Updated for Python 3
1f2a252
@billtubbs
Updated for Python 3
bac4d87
@billtubbs
Tested in Python 3.7
fa31119
@billtubbs
Edited to comply with Python PEPs
0d3a656
Removed MATLAB-like formatting such as semi-colons, syntax and indenting PEP compliant (using PyCharm), changed imports from `from ___ import *` to things like `import matplotlib.pyplot as plt` and `import numpy as np`, removed tabs
@coveralls

coveralls commented Jun 8, 2019 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown

Coverage Status

Coverage remained the same at 80.936% when pulling 5648440 on billtubbs:bt-tests into 8a11cd3 on python-control:master.

All reactions

Sorry, something went wrong.

Uh oh!

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

murrayrm
murrayrm reviewed Jun 8, 2019
View reviewed changes
Comment thread examples/pvtol-lqr.py Resolved

Uh oh!

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

Comment thread examples/pvtol-nested-ss.py Resolved

Uh oh!

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

Comment thread examples/pvtol-nested-ss.py Resolved

Uh oh!

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

Comment thread examples/pvtol-lqr.py Resolved

Uh oh!

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

Comment thread examples/pvtol-nested.py Outdated
if ax.get_label() == 'control-bode-magnitude':
break
ax.semilogx([1e-4, 1e3], 20 * np.log10([1, 1]), 'k-')
ax.semilogx([1e-4, 1e3], 20*np.log10([1, 1]), 'k-')

@murrayrm murrayrm Jun 8, 2019

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.

Should this be indented? It means that it could get executed multiple times?

Sorry, something went wrong.

Uh oh!

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

All reactions

@billtubbs billtubbs Jun 8, 2019

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.

Oops! I misunderstood that. Will revert it back.

Sorry, something went wrong.

Uh oh!

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

All reactions

@murrayrm murrayrm Jun 8, 2019

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.

Looks like this line is still indented and shouldn't be?

Sorry, something went wrong.

Uh oh!

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

All reactions
@murrayrm

murrayrm commented Jun 8, 2019

Copy link
Copy Markdown
Member

@billtubbs Did a quick look through the changes. Overall they look good! Some small comments/questions for you to consider, but I think this is fine as is. Will give you a chance to update in case any of the comments resonate, but then we can merge these in.

All reactions

Sorry, something went wrong.

Uh oh!

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

billtubbs added 8 commits June 8, 2019 14:08
@billtubbs
Removed spacing around * and / operators for consistency and as p…
7e70e8a
…er PEP 8.
@billtubbs
Refactored name 'ord' which conflicts with built-in.
ebc5137
@billtubbs
Reformatted comments
fddbf0f
@billtubbs
Reversed previous mistaken edit.
1555a5b
@billtubbs
Removed tab characters
ddad0a7
@billtubbs
Replaced np.matrix with np.array objects
51a772b
@billtubbs
Replaced np.matrix with np.array objects
0df099f
@billtubbs
Reverted previous mistaken edit
5648440
@murrayrm
murrayrm merged commit c99f72f into python-control:master Jun 9, 2019
@murrayrm murrayrm mentioned this pull request Jun 9, 2019
Figure 6 in examples/pvtol-nested-ss.py is incorrect #309
Closed
@billtubbs
billtubbs deleted the bt-tests branch June 9, 2019 03:21
@murrayrm murrayrm mentioned this pull request Jun 9, 2019
update examples to python 3 #208
Closed
@murrayrm murrayrm added this to the 0.8.3 milestone Jan 4, 2020
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

Uh oh!

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

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

0.8.3

Development

Successfully merging this pull request may close these issues.

Uh oh!

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

3 participants

@billtubbs @coveralls @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 01402520 — 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.