Delete the eight functions nobody called

Measured, not guessed: every top-level def in every tracked .py file was
counted against every other tracked file, including markdown, scripts, Go
and TypeScript. Eight names had zero references anywhere:
cartridges_holding_atom and clear_mounts (memory.py reads each cartridge's
own sources.json, and set_mounts already clears by replacing the set),
gradient_checkpointing_enabled, group_hits_by_source, ingested_paths,
is_finite_number, parse_runtime_json (the runtime answers in prose now, and
the JSON path was never wired back), write_sources_json.

Typer commands and pytest cases were excluded from the count because a
framework calls them by name. The same scan now returns zero.

263 tests pass; repo-wide mypy is still 24 errors in 6 files, unchanged.
This commit is contained in:
ZacharyZhang-NY committed 2026-10-08 07:38:36 -04:00
1 parent 330e801e92
commit 56b94cd58e
7 files changed
-59

No files matched your search

-9
View File
@@ -1313,15 +1313,6 @@ def model_type_for_proof(model: Any) -> str | None:
return None
def gradient_checkpointing_enabled(model: Any) -> bool:
if bool(getattr(model, "is_gradient_checkpointing", False)):
return True
config = getattr(model, "config", None)
if bool(getattr(config, "gradient_checkpointing", False)):
return True
return bool(getattr(model, "_gradient_checkpointing_func", None))
def make_optimizer(model: Any, learning_rate: float) -> tuple[Any, str]:
params = [param for param in model.parameters() if param.requires_grad]
try: