Skip to content

Repository-wide audit: clean up stale docstrings, dead exports, and deprecated script references #1091

Description

@rahul-tuli

Motivation.

As the codebase has evolved across recent refactors, various docstrings, module comments, exports, and documentation references have become outdated.

A general audit across the repository is needed to identify and clean up stale references, dead symbols, and obsolete script paths to maintain high documentation integrity and prevent newcomer confusion.

Below is a preliminary, non-exhaustive list of examples discovered during an initial sweep that illustrate the avenues for cleanup:

  1. Dead exports in __all__ causing runtime import errors:

    • In src/speculators/utils/__init__.py, __all__ contains "AutoImporterMixin", which was removed and no longer exists anywhere in the repository. As a result, wildcard imports fail:
      >>> from speculators.utils import *
      AttributeError: module 'speculators.utils' has no attribute 'AutoImporterMixin'
  2. Stale class/method references and typos in docstrings:

    • In src/speculators/utils/registry.py:
      • Lines 15–16: The module docstring mentions AutoClassRegistryMixin, which has been completely removed from the file.
      • Lines 170–173: The docstring for registered_classes() refers to a non-existent auto_populate_registry method.
      • Lines 139–140: Missing trailing space in TypeError string concatenation ("without invocation." f"Got improper clazz arg {clazz}." becomes "without invocation.Got improper...").
      • Line 149: Typo in ValueError message: "Got imporoper name arg {name}." (imporoper -> improper).
  3. Docstring parameter mismatches causing documentation build warnings:

  4. Stale references to deprecated scripts/*.py entrypoints:

Proposed Change.

  1. Audit & Cleanup:

    • Perform a sweep across docstrings, comments, and module exports to identify and remove obsolete references to deleted classes, methods, and deprecated runner scripts.
    • Address the known preliminary items outlined in the motivation.
    • Clean up __all__ in src/speculators/utils/__init__.py and add a unit test in tests/unit/utils/test_registry.py ensuring all exported symbols can be imported cleanly without AttributeError.
    • Update model config docstrings to align with Google-style Attributes: blocks so that uv run mkdocs build runs with zero Griffe parameter warnings.
    • Update mentions of deprecated scripts/*.py in docstrings, test headers, and documentation to reference the corresponding modern CLI command (speculators <command> or torchrun -m speculators.train).
  2. Validation:

    • Verify wildcard imports: uv run python -c "from speculators.utils import *"
    • Verify docs build: uv run mkdocs build
    • Verify code formatting and linting: uv run ruff check and uv run ruff format --check
    • Verify unit tests: uv run pytest tests/unit/utils/

Any Other Things.

  • The items listed above serve as starting points from an initial scan; contributors are encouraged to audit other packages under src/speculators/ for similar stale docstrings or dead references.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentationgood first issueGood for newcomers

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions