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 — Remove old pythons and leverage @ operator by bnavigator · Pull Request #679 · python-control/python-control

Conversation

@bnavigator

@bnavigator bnavigator commented Dec 2, 2021

Copy link
Copy Markdown
Contributor

We should finally let go of Python 2. It will allow us to use the matmul operator @ and make code more readable.

As NumPy has deprecated Python 3.6 support a while ago (NEP 29), Conda recently dropped it and it will also reach end-of-life in the mainline Python this month, let's also stop testing Python 3.6.

There is an important difference to consider when replacing np.dot or ndarray.dot with @:

  • Multiplication by scalars is not allowed, use * instead.
  • Stacks of matrices are broadcast together as if the matrices were elements, respecting the signature (n,k),(k,m)->(n,m):

Sorry, something went wrong.

Uh oh!

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

All reactions
bnavigator added 8 commits December 2, 2021 13:06
@bnavigator
remove support declaration for EOL Python 2 and 3.6
2123d52
@bnavigator
remove python2 future imports
7d97ef9
@bnavigator
remove travis config
f8534a0
@bnavigator
bump minimum python version in GHA conda tests
12f9014
@bnavigator
replace np.dot with @ matmul operator where applicable
19cc79a
@bnavigator
replace ndarray.dot() with @
6b96c7f
@bnavigator
replace np.dot with @ matmul operator where applicable in tests
de85969
@bnavigator
replace ndarray.dot in tests
5b28121
@bnavigator
bnavigator force-pushed the remove-old-python branch from 0a713de to 6b96c7f Compare December 2, 2021 18:08
@coveralls

coveralls commented Dec 2, 2021 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.005%) to 92.721% when pulling de94123 on bnavigator:remove-old-python into c2f6f8a on python-control:master.

All reactions

Sorry, something went wrong.

Uh oh!

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

@bnavigator bnavigator mentioned this pull request Dec 2, 2021
vectorize FRD feedback function #680
Merged
@bnavigator
Merge branch 'master' into remove-old-python
de94123
@sawyerbfuller

sawyerbfuller commented Dec 9, 2021

Copy link
Copy Markdown
Contributor

I was really excited when python got the matrix mult operator. really cleans up the code. So it sounds reasonable to me if nobody can give a good reason to keep python 2 around.

All reactions

Sorry, something went wrong.

Uh oh!

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

sawyerbfuller
sawyerbfuller approved these changes Dec 9, 2021
View reviewed changes
@murrayrm
murrayrm merged commit 4f681ab into python-control:master Dec 26, 2021
@murrayrm murrayrm added this to the 0.9.1 milestone Dec 30, 2021
@bnavigator
bnavigator deleted the remove-old-python branch February 18, 2024 20:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

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

Development

Successfully merging this pull request may close these issues.

Uh oh!

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

4 participants

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