Skip to content

chore: clear ruff findings and fix docstring hover rendering - #20

Merged
AlexanderSoftCode merged 3 commits into
mainfrom
chore/lint-cleanup-docstrings
Oct 30, 2026
Merged

AlexanderSoftCode merged 3 commits into
mainfrom
chore/lint-cleanup-docstrings

Conversation

@AlexanderSoftCode

Copy link
Copy Markdown
Owner

Context

Ruff reported 49 findings, none on recently touched code, and several docstrings
rendered badly in editor hovers. This PR clears the lint backlog and fixes the
docstrings. It also adds a package docstring, because help(aether) and hover
showed nothing useful with the lazy-loaded public names.

Three commits:

  • chore(lint): mostly mechanical (ruff --fix for unused imports, typing syntax,
    nested with, import order). Review the test files with git diff -w.
  • docs: docstring-only.
  • docs(aether): docstring-only.

Lint

Auto-fixed: unused imports, Optional/Union/Tuple annotations, nested with
statements, a redundant return None, import order.

Fixed by hand:

  • adam_base_suite.py: removed a try/except Exception that only called
    self.fail. A kernel failure now surfaces as a test error with its traceback.
  • model_base_suite.py: target_device was computed but the same expression was
    repeated inline. Both model.to(...) calls now use the variable.
  • test_max_pool2d.py: dropped an unused layer =.
  • batchnorm_kernel.py: variant: str | None = None.

Ignored on purpose:

  • RUF022 for *.pyi: stub __all__ lists are grouped by topic, not sorted.
  • F401 and PIE790 for the integration test skeleton: its placeholder imports
    and pass bodies are intentional.
  • TRY004 on Loss.validate_graph: inline noqa, because its ValueError is a
    tested public error type.

Docstrings

The language server's hover joins nested bullets under an Args entry into one
paragraph, and shows ** as literal asterisks. The verbose entries in
Model.train() and Model.evaluate() now describe their modes inline, and the
**Label:** markers in Notes sections are plain labels (9 places across 4 files).

aether/__init__.py and aether/__init__.pyi get a short package docstring: what
the framework is, lazy loading, and that the backend is chosen with Model.to().
It leaves out class lists and the version, which the lazy maps, stub and package
metadata already cover.

Behavior changes

None.

Testing

  • python3 -m unittest discover tests: 1158 tests pass (72 skipped), run in the
    ROCm devcontainer.
  • ruff check . passes.
  • No new tests: the changes are lint and docstrings, with no behavior change.
  • The hover rendering in Zed was not re-checked after the docstring edits.

Follow-ups (out of scope)

  • Two tests fail on Windows; fixing them is the next PR.
  • pyproject.toml still says 1.1.0. The version bump for the next release goes
    in the Windows-fix PR.
  • Benchmarks.

Remove unused imports and variables, modernize typing annotations,
merge nested with statements, and drop a blind except in a test.
Add per-file ignores for the integration test skeleton and .pyi
__all__ ordering, and a TRY004 noqa on validate_graph, whose
ValueError is a public contract.
Nested bullets under an Args entry get joined into one paragraph in
the language server's hover rendering, and ** shows up as literal
asterisks. Describe the verbose modes inline in train and evaluate,
and use plain labels in the Notes sections.
The public names load lazily, so help(aether) and hover showed
nothing. Add a short orientation docstring to __init__.py and the
.pyi stub, which language servers resolve in its place.
@AlexanderSoftCode
AlexanderSoftCode merged commit da8445a into main Oct 30, 2026
5 checks passed
@AlexanderSoftCode
AlexanderSoftCode deleted the chore/lint-cleanup-docstrings branch October 30, 2026 22:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant