Closed EwoutH closed 8 months ago
i'm not sure if we want to try to enforce pre-commit, just want to make it lightweight for people to hack on stuff :)
you'll need to rebase this though since we pushed some other changes, sorry
Thanks for getting back! We can decide that later.
I've rebased this PR.
This PR applies consistent formatting with Black, Python 3.7+ syntax updates, whitespace and syntax checks, and code simplification. This improves the readability and maintainability of the codebase and aligns it (pun intended) with current Python best practices.
A pre-commit config is added to ensure these changes can be consistently applied in the future. Ideally, this would be supported by a CI configuration like pre-commit.ci.
Key Changes:
pyproject.toml
. This standardizes the code style across the project. A line length of 100 was chosen because many files already were formatted to that (approximate) line length, minimizing changes.common.py
and other files to use Python 3.7+ syntax. This modernizes the codebase and removes legacy constructs.toml
andyaml
syntax.Plotting.ipynb
andtrain_weak_to_strong.py
. For example, multiline expressions have been simplified for better readability.\I would advice against squashing when merging, I think it's useful to keep the individual commits.