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

pep8 cleanup for one file in quadratic_forms #34304

Closed
fchapoton opened this issue Aug 8, 2022 · 27 comments
Closed

pep8 cleanup for one file in quadratic_forms #34304

fchapoton opened this issue Aug 8, 2022 · 27 comments

Comments

@fchapoton
Copy link
Contributor

also a few code and doc details

CC: @tscrim @kwankyu @slel @dcoudert

Component: quadratic forms

Author: Frédéric Chapoton

Branch/Commit: 15f50e0

Reviewer: Kwankyu Lee

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

@fchapoton fchapoton added this to the sage-9.7 milestone Aug 8, 2022
@fchapoton
Copy link
Contributor Author

Commit: f0be16d

@fchapoton
Copy link
Contributor Author

Branch: u/chapoton/34304

@fchapoton
Copy link
Contributor Author

New commits:

f0be16dpep8 for one file in quadratic_forms (renamed file)

@mkoeppe
Copy link
Member

mkoeppe commented Aug 8, 2022

comment:2
diff --git a/src/sage/quadratic_forms/quadratic_form.py b/src/sage/quadratic_forms/quadratic_form.py
index f5ac84b..e76e1ab 100644
--- a/src/sage/quadratic_forms/quadratic_form.py
+++ b/src/sage/quadratic_forms/quadratic_form.py
@@ -453,13 +453,13 @@ class QuadraticForm(SageObject):
...
+    from sage.quadratic_forms.local_representation_conditions import (
+        local_representation_conditions,

I think it's problematic that the imported name local_representation_conditions shadows the module name sage.quadratic_forms.local_representation_conditions

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Aug 8, 2022

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

ff822a6pep8 for one file in quadratic_forms (renamed file)

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Aug 8, 2022

Changed commit from f0be16d to ff822a6

@fchapoton
Copy link
Contributor Author

comment:4

ok, right. Now with a shorter filename

@slel
Copy link
Member

slel commented Aug 8, 2022

comment:5

The .. TODO:: block seems indented by 3 spaces instead of 4.

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Aug 8, 2022

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

9aa09a1indent TODO

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Aug 8, 2022

Changed commit from ff822a6 to 9aa09a1

@fchapoton
Copy link
Contributor Author

comment:7

voila

@fchapoton
Copy link
Contributor Author

comment:8

review, please?

@kwankyu
Copy link
Collaborator

kwankyu commented Aug 16, 2022

comment:9

You renamed sage.quadratic_forms.quadratic_form__local_representation_conditions to sage.quadratic_forms.local_representation.

There are many sage.quadratic_forms.quadratic_form__xxx modules in the same package. Hence your change make only one of those modules out of the naming pattern.

Why only one module? Do you plan to change the name of other modules too?

If you plan to change them all, how about the pattern sage.quadratic_forms._local_representation_conditions?

And I think we should keep the original name local_representation_conditions as the original author intended.

@fchapoton
Copy link
Contributor Author

comment:10

I changed only one filename to avoid controversy.

My first choice for the shorter name was indeed local_representation_conditions but objected in comment:2 so I picked a shorter one.

There are also many files in the folder that already do not follow the pattern quadratic_form__xxx so I am not breaking the pattern.

@kwankyu
Copy link
Collaborator

kwankyu commented Aug 16, 2022

comment:11

Replying to @fchapoton:

My first choice for the shorter name was indeed local_representation_conditions but objected in comment:2 so I picked a shorter one.

I understood. But dropping a word has danger of changing the meaning. So instead of dropping a part, I suggested to add the prefix _. Then this pattern may be applied to other similar files later...

@fchapoton
Copy link
Contributor Author

comment:12

Sorry, using the prefix _ for a module name does not look like a good idea.

Let's try to choose another name, that would suit everybody..

Maybe local_representation_criteria ?

@kwankyu
Copy link
Collaborator

kwankyu commented Aug 16, 2022

comment:13

If the aim is to have a short name, how about

qf__local_representation_conditions

?

@kwankyu
Copy link
Collaborator

kwankyu commented Aug 16, 2022

comment:14

I think these modules quadratic_form__xxx are special in that they were created to provide class method definitions in separate files. So a slightly non-conventional naming is okay if it could satisfy the style checker. Like the prefix qf__ :)

@mkoeppe
Copy link
Member

mkoeppe commented Aug 16, 2022

comment:15

It may make sense to change it back to the original for this ticket, and open a separate ticket for doing all renames simultaneously.

@tscrim
Copy link
Collaborator

tscrim commented Aug 17, 2022

comment:16

My 2 cents.

I agree with Matthias in comment:15; we should rename all of them on one (separate) ticket.

I am +1 on removing quadratic_form__ from all of the filenames as they are redundant with the folder name.

I am not so worried about comment:2; we have ways of resolving such conflicts with, e.g., import foo as bar. Yet, it would be good to avoid that for us humans who get confused.

@kwankyu
Copy link
Collaborator

kwankyu commented Aug 17, 2022

comment:17

Replying to @mkoeppe:

It may make sense to change it back to the original for this ticket, and open a separate ticket for doing all renames simultaneously.

+1.

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Aug 17, 2022

Changed commit from 9aa09a1 to 15f50e0

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Aug 17, 2022

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

15f50e0pep8 for one file in quadratic_forms

@fchapoton
Copy link
Contributor Author

comment:19

ok, so here is a branch not renaming the modified file

@kwankyu
Copy link
Collaborator

kwankyu commented Aug 17, 2022

Reviewer: Kwankyu Lee

@kwankyu
Copy link
Collaborator

kwankyu commented Aug 17, 2022

comment:20

LGTM.

@vbraun
Copy link
Member

vbraun commented Aug 30, 2022

Changed branch from u/chapoton/34304 to 15f50e0

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

6 participants