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

fix E713 and E714 in matrix, modules, groups #32766

Closed
fchapoton opened this issue Oct 25, 2021 · 10 comments
Closed

fix E713 and E714 in matrix, modules, groups #32766

fchapoton opened this issue Oct 25, 2021 · 10 comments

Comments

@fchapoton
Copy link
Contributor

about negative comparison using "is not"

Component: refactoring

Author: Frédéric Chapoton

Branch/Commit: 9c1d6b4

Reviewer: Matthias Koeppe

Issue created by migration from https://trac.sagemath.org/ticket/32766

@fchapoton fchapoton added this to the sage-9.5 milestone Oct 25, 2021
@fchapoton
Copy link
Contributor Author

Branch: u/chapoton/32766

@fchapoton
Copy link
Contributor Author

Commit: ea822d0

@fchapoton
Copy link
Contributor Author

New commits:

ea822d0fix E713 and E714 in matrix, groups, modules

@mkoeppe
Copy link
Contributor

mkoeppe commented Oct 25, 2021

comment:2

The failure in src/sage/rings/integer.pyx is not from this ticket.

@mkoeppe
Copy link
Contributor

mkoeppe commented Oct 25, 2021

comment:3
--- a/src/sage/modules/with_basis/morphism.py
+++ b/src/sage/modules/with_basis/morphism.py
@@ -175,11 +175,11 @@ class ModuleMorphism(Morphism):
             sage: TestSuite(phi).run()
         """
         if category is None:
-            if not domain in ModulesWithBasis:
-                raise ValueError("domain(=%s) should be a module with basis"%(codomain))
+            if domain not in ModulesWithBasis:
+                raise ValueError("domain(=%s) should be a module with basis" % (codomain))
             base_ring = domain.base_ring()
 
-            if not hasattr( codomain, 'base_ring' ):
+            if not hasattr(codomain, 'base_ring'):
                 raise ValueError("codomain(=%s) needs to have a base_ring attribute"%(codomain))
             # codomain should be a module over base_ring
             # The natural test would be ``codomains in Modules(base_ring)``

In these changes, could also remove the parentheses around codomain.

Otherwise LGTM, feel free to set to positive_review.

@mkoeppe
Copy link
Contributor

mkoeppe commented Oct 25, 2021

Reviewer: Matthias Koeppe

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Oct 26, 2021

Branch pushed to git repo; I updated commit sha1. New commits:

9c1d6b4some details

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Oct 26, 2021

Changed commit from ea822d0 to 9c1d6b4

@fchapoton
Copy link
Contributor Author

comment:6

ok, fixed. Thanks

I allow myself to set to positive

@vbraun
Copy link
Member

vbraun commented Oct 31, 2021

Changed branch from u/chapoton/32766 to 9c1d6b4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants