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

Checks: fix flake8 E741 remainder #3928

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

mshukuno
Copy link
Contributor

Reminder of E741 fixes for the "locale", "python", and "scripts" directories. The majority of fixes involved renaming variable names in iterables. The "noqa: E741" was added to "scripts/d.rast.leg/d.rast.leg.py" since it didn't make sense to change just the "l".

@github-actions github-actions bot added raster Related to raster data processing Python Related code is in Python translation Message translation related database Related to database management libraries module display labels Jun 25, 2024
Copy link
Member

@echoix echoix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have two questions in two files, all the others are fine as is with me.

def getmaprow_CELL(fd, buf, row, l):
def getmaprow_CELL(fd, buf, row):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this affect compatibility with the C-libraries or its Python wrappers (like ctypes)
Who can answer this?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's the only point that needs to be answered by someone else

@@ -313,23 +313,23 @@ def main():
pval[i] = 0

inf = open(tmp + ".sort")
l = 1
ln = 1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a better name for this one? What was the reasoning for it (does it come from a formula or something)?

I'm reading it like the natural logarithm (ln), like in maths, but doesn't make sense.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The "line_number" is what I meant. The logarithm didn't occur to me, but you're right. Would "line_number" or "counter" make sense?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

line_number sounds better than counter for me.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, a note for other readers: I don't know if this part of code is critical or not, but that loop and double loop is probably quite inefficient. Probably doing a "in" check (with a pre-created local tuple) once per loop, and in the 4+pops times it matches, then find the correct assignment.

It's not something to do with this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
database Related to database management display libraries module Python Related code is in Python raster Related to raster data processing translation Message translation related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants