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

temporal: Fix FLY002: String-join inefficiencies in temporal/t.register tests #5087

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

Conversation

arohanajit
Copy link
Contributor

Fixed FLY002 and used f-strings instead of join in t.register/

@github-actions github-actions bot added temporal Related to temporal data processing Python Related code is in Python module tests Related to Test Suite labels Feb 11, 2025
@echoix
Copy link
Member

echoix commented Feb 11, 2025

@arohanajit Can your titles when making fixes using ruff be more specific? If you're fixing one rule, for one module, it will be way easier to find and understand when looking at the history what was changed.

There's hundreds of rules from all linters in ruff, and hundreds of files here, so I feel like saying "ruff errors" could be applied to dozens and dozens of PRs doing totally different things.

But, at least, you add the error code in the PR, but most often, since your commit messages only mention "update", once merged, that error code isn't searchable, when searching for a commit.

@echoix
Copy link
Member

echoix commented Feb 11, 2025

To know if it's specific enough: put yourself as the one that needs to find a commit to revert since something broke. You know what rule change caused the problem, and try to find the commits up to where do your bisect. If it's hard to find these commits, it's maybe not precise enough

@wenzeslaus wenzeslaus changed the title temporal: Fixed ruff errors in t.register/ temporal: Fixed ruff errors in t.register Feb 12, 2025
@wenzeslaus
Copy link
Member

To add to what @echoix is saying, it is clear that you are trying to fix things (including the word "Fix" is great, but not enough). It is also clear which directory or file it is when just a prefix or one name is included (t.register or temporal, but not both). Similarly, it does not add much to know that you are fixing errors, that's sort of expected, but which errors, that's the question.

If it is hard to express all changes in a title and be specific enough at the same time, maybe it is time to split the PR into two.

To @echoix's note on trying to see where the commit message (PR title) appears see (latest commits, history of one file, and blame):

https://github.com/OSGeo/grass/commits/main/
https://github.com/OSGeo/grass/commits/main/scripts/d.shade/d.shade.py
https://github.com/OSGeo/grass/blame/main/scripts/d.shade/d.shade.py

@echoix
Copy link
Member

echoix commented Feb 12, 2025

To be clear, the work is not bad ;)
It's to help get it even better and more useful for long-term reference (decades time span)

@arohanajit
Copy link
Contributor Author

Thanks @wenzeslaus and @echoix I'll keep this in mind in future PRs

@petrasovaa
Copy link
Contributor

Thanks @wenzeslaus and @echoix I'll keep this in mind in future PRs

So are you able to edit the PR title or you don't have permissions?

"prec_6|...|2499-11-16 21:00:00|None",
]
)
ref_str = """name|mapset|start_time|end_time...
Copy link
Contributor

Choose a reason for hiding this comment

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

This part is still failing in the CI

@petrasovaa
Copy link
Contributor

@arohanajit unrelated to this PR, if you check the CI, there is lot's of noisy numpy warnings and ResourceWarnings, could you look into that (not in this PR)? I wonder if there was any issue/discussion about this already, do you know @echoix?

@echoix
Copy link
Member

echoix commented Feb 13, 2025

The numpy warnings are from doctests, and that is what is blocking testing with newer OS/Python versions like 3.13

First issue:

Solving this would unblock

Also see:

After all that time, I feel like we might need to decide to not run doctests for every version. It would be impossible to always satisfy all. (Unless the doctests have conditionnals, that would be ugly)

@echoix
Copy link
Member

echoix commented Feb 13, 2025

For the resource warnings, at build time I see that there's some related to the files that make documentation (maybe mkhtml), so probably a fix like #5063 needs to be applied, or the devnull one from #4917 (comment)

@echoix
Copy link
Member

echoix commented Feb 13, 2025

Otherwise, it might be in doctests that we'll need to look at

@arohanajit
Copy link
Contributor Author

@arohanajit unrelated to this PR, if you check the CI, there is lot's of noisy numpy warnings and ResourceWarnings, could you look into that (not in this PR)? I wonder if there was any issue/discussion about this already, do you know @echoix?

Got it, I'll start working on this after finishing with all the ruff errros

@arohanajit arohanajit changed the title temporal: Fixed ruff errors in t.register temporal: Fix FLY002: String-join inefficiencies in temporal/t.register tests Feb 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module Python Related code is in Python temporal Related to temporal data processing tests Related to Test Suite
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants