Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove old pythons and leverage @ operator #679

Merged
merged 9 commits into from Dec 26, 2021

Conversation

bnavigator
Copy link
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):

@coveralls
Copy link

coveralls commented Dec 2, 2021

Coverage Status

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

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

@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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants