Clean up the comments and lint the notebooks #22

Merged
alexander merged 19 commits from lint-cleanups into develop 2026-12-03 12:26:19 +01:00
Owner

Comments

  • Comments follow one style: One sentence without a final period,
    or two short sentences joined by "=>"
  • Comments explain the "why", not the "what"
  • Identifiers are in backticks, and multi-line comments break before conjunctions
  • Sources are referred to with "See:"

Imports

  • All re-exporting packages declare __all__
  • The F401 ignore for __init__.py files is gone

Notebooks

  • ruff lints the notebooks in research/ in the lint session
  • All fixes keep the values the same, so the stored outputs stay valid
    without rerunning the notebooks
  • The formatters skip the notebooks so they do not rewrite the cells
## Comments - Comments follow one style: One sentence without a final period, or two short sentences joined by "=>" - Comments explain the "why", not the "what" - Identifiers are in backticks, and multi-line comments break before conjunctions - Sources are referred to with "See:" ## Imports - All re-exporting packages declare `__all__` - The F401 ignore for `__init__.py` files is gone ## Notebooks - `ruff` lints the notebooks in `research/` in the `lint` session - All fixes keep the values the same, so the stored outputs stay valid without rerunning the notebooks - The formatters skip the notebooks so they do not rewrite the cells
Then, the linters know the imports are re-exports and not unused.
All re-exporting packages declare `__all__`;
so, unused imports are reported there, too.
Each comment is one sentence or two short ones joined by "=>", without a final period.
Each comment is one sentence or two short ones
joined by "=>", without a final period.
Each comment is one sentence or two short ones
joined by "=>", without a final period.
Each comment is one sentence or two short ones
joined by "=>", without a final period.
Each comment is one sentence or two short ones
joined by "=>", without a final period.
Comments that only repeated the code are removed.
The fixes keep every value the same, so the stored outputs stay valid.
For example, `np.NaN` becomes `np.nan`, which `numpy` v2 requires.
`isnull()` and `notnull()` are mere aliases,
so the stored outputs stay valid.
Every change keeps the values the same, so the stored outputs stay valid.
`init_r` keeps its import because only its side effect matters.
Only `ruff` checks them because the formatters would rewrite the cells.

The per-file ignores fit exploratory code that is never rerun.
Each reason now sits next to its codes,
which reads better than a separate list.
Skip the per-file ignores reformatting in git blame
All checks were successful
CI / Tests (test-types) (push) Successful in 2m8s
CI / Tests (test) (push) Successful in 2m11s
CI / Tests (test-with-3.15) (push) Successful in 2m15s
CI / Tests (test-with-3.13) (push) Successful in 2m22s
CI / Lint (push) Successful in 2m39s
f9fce093d1
alexander merged commit 2bfd936087 into develop 2026-12-03 12:26:19 +01:00
alexander deleted branch lint-cleanups 2026-12-03 12:26:19 +01:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
alexander/velofy!22
No description provided.