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:
1 parent
330e801e92
commit
56b94cd58e
7 files changed
-59
No files matched your search
@@ -1,7 +1,6 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import base64
|
||||
import json
|
||||
import logging
|
||||
import subprocess
|
||||
from dataclasses import dataclass
|
||||
@@ -429,17 +428,3 @@ def gpu_status() -> dict[str, Any]:
|
||||
}
|
||||
|
||||
|
||||
def parse_runtime_json(text: str) -> dict[str, Any]:
|
||||
stripped = text.strip()
|
||||
if stripped.startswith("```"):
|
||||
stripped = stripped.strip("`")
|
||||
if stripped.lower().startswith("json"):
|
||||
stripped = stripped[4:].strip()
|
||||
try:
|
||||
return json.loads(stripped)
|
||||
except json.JSONDecodeError:
|
||||
start = stripped.find("{")
|
||||
end = stripped.rfind("}")
|
||||
if start >= 0 and end > start:
|
||||
return json.loads(stripped[start : end + 1])
|
||||
raise
|
||||
Reference in new issue
Block a user