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

pep cleanup for the quivers folder #28461

Closed
fchapoton opened this issue Sep 7, 2019 · 11 comments
Closed

pep cleanup for the quivers folder #28461

fchapoton opened this issue Sep 7, 2019 · 11 comments

Comments

@fchapoton
Copy link
Contributor

mainly cosmetic changes in code presentation

CC: @tscrim

Component: algebra

Author: Frédéric Chapoton

Branch/Commit: e7695d3

Reviewer: Travis Scrimshaw

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

@fchapoton fchapoton added this to the sage-8.9 milestone Sep 7, 2019
@fchapoton
Copy link
Contributor Author

Branch: u/chapoton/28461

@fchapoton
Copy link
Contributor Author

Commit: 08cc7dc

@fchapoton
Copy link
Contributor Author

New commits:

08cc7dcpep cleanup for the quivers folder

@fchapoton
Copy link
Contributor Author

comment:2

green bot, please review

@tscrim
Copy link
Collaborator

tscrim commented Sep 7, 2019

comment:3

Is there a reason why you didn't also change this to a dict comprehension?

-        elems = dict((v, self._left_action_mats[edge][v]*element._elems[v]) for v in self._quiver)
+        elems = dict((v, self._left_action_mats[edge][v]*element._elems[v])
+                     for v in self._quiver)

In this change:

-        result = parent()   # this must not be the cached parent.zero(),
-                             # since otherwise it gets changed in place!!
+        result = parent()
+        # this must not be the cached parent.zero(),
+        # since otherwise it gets changed in place!!

I think it would be better for the comment to go first. Also, in principle, the result of parent() could use the cached zero method since we assume elements are immutable. So I think it would be better (and faster) to explicitly construct the zero element.

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Sep 8, 2019

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

a433abdMerge branch 'u/chapoton/28461' in 8.9.b9
e7695d3trac 28461 fix some details

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Sep 8, 2019

Changed commit from 08cc7dc to e7695d3

@fchapoton
Copy link
Contributor Author

comment:5

I have made the trivial changes that you suggested.

Concerning the zero, it seems that there is really a problem. This looks serious enough that it should be kept for a dedicated ticket. Moreover, I am not sure that the coercion framework is used correctly, as this happens inside a double underscore method __mul__.

@tscrim
Copy link
Collaborator

tscrim commented Sep 8, 2019

comment:6

Replying to @fchapoton:

I have made the trivial changes that you suggested.

Thank you.

Concerning the zero, it seems that there is really a problem. This looks serious enough that it should be kept for a dedicated ticket. Moreover, I am not sure that the coercion framework is used correctly, as this happens inside a double underscore method __mul__.

Sounds good. cc me on that and I can do the review, or I can make the change tomorrow if you have not started on it already.

@tscrim
Copy link
Collaborator

tscrim commented Sep 8, 2019

Reviewer: Travis Scrimshaw

@vbraun
Copy link
Member

vbraun commented Sep 10, 2019

Changed branch from u/chapoton/28461 to e7695d3

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