-
Notifications
You must be signed in to change notification settings - Fork 53
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
chore: replace black, isort, absolufy-imports with ruff #328
Conversation
I think this step can go as well: linopy/.github/workflows/test.yml Line 86 in b1a52dc
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #328 +/- ##
==========================================
+ Coverage 85.95% 86.00% +0.04%
==========================================
Files 17 17
Lines 4202 4209 +7
Branches 988 989 +1
==========================================
+ Hits 3612 3620 +8
+ Misses 431 430 -1
Partials 159 159 ☔ View full report in Codecov by Sentry. |
Great! Still some issues in the benchmark folder with pre-commit https://results.pre-commit.ci/run/github/350276805/1721223837.ZE-YcKwTRuaSNDuB4ykaXA, we can either ignore that folder or quickly fix these |
sure |
Maybe ignore F821 ( |
sure! |
$ ruff check --statistics
21 NPY002 numpy-legacy-random
5 F821 undefined-name
1 F401 unused-import
1 F601 multi-value-repeated-key-literal |
Which linopy/test/test_optimization.py Lines 410 to 413 in 717acba
|
oh honestly, only one (ideally the correct one ;) ) should be used |
Fabian Hofmann committed on Sep 19, 2023. :) |
$ ruff check --statistics
5 F821 undefined-name
1 F401 unused-import
1 F601 multi-value-repeated-key-literal |
Could you also add a
And maybe don't squash this, so we keep those ruff changes separated. The
|
You mean whether the user should be able to import it? No, that not, but the module should internally be run when importing linopy. (hope I got your point) |
Makes sense. Then it's a |
Alright. I will squash all ruff commits and add the one commit to .git-blame-ignore-revs? So, you get 3 commits to merge, 1 commit adds the rule, 1 commit applies the rules and changes a lot of files, 1 commit adds the .git-blame-ignore-revs. Is that correct? |
@afuetterer great work as always! just some minor things remaining where pre-commit complains, should be a quick thing to do, perhaps @lkstrp can also do it :) |
Let me fix it quickly. |
$ ruff check --statistics
2 F841 [*] unused-variable ruff wants to remove the |
Just add As always, thanks a lot @afuetterer ! |
This should be it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Beautiful!
PyPSA already uses ruff via pre-commit:
https://github.com/PyPSA/PyPSA/blob/master/.pre-commit-config.yaml
I replaced the tooling.
There are a few issues.