tenseleyflow/documentlanguagemodel / e56a0cc

Browse files

Fix formatting drift

Authored by mfwolffe <wolffemf@dukes.jmu.edu>
SHA
e56a0ccecea08bbe6851b17d422d97db6886f2d2
Parents
3b03508
Tree
cd43167

4 changed files

StatusFile+-
M src/dlm/metrics/queries.py 1 3
M src/dlm/train/trainer.py 1 3
M tests/unit/cli/test_cache_prune_frontmatter_default.py 2 8
M tests/unit/cli/test_show_cache_config.py 4 15
src/dlm/metrics/queries.pymodified
@@ -205,9 +205,7 @@ def latest_gate_events(store_root: Path) -> list[GateEventRow]:
205205
     gate. Empty list when no run has gate-event rows yet."""
206206
     try:
207207
         with connect(store_root) as conn:
208
-            row = conn.execute(
209
-                "SELECT MAX(run_id) FROM gate_events"
210
-            ).fetchone()
208
+            row = conn.execute("SELECT MAX(run_id) FROM gate_events").fetchone()
211209
     except sqlite3.Error:
212210
         return []
213211
     if row is None or row[0] is None:
src/dlm/train/trainer.pymodified
@@ -850,9 +850,7 @@ def _maybe_pretokenize_datasets( # pragma: no cover — real path is covered by
850850
         # Sprint 31.6: `training.cache.max_bytes` overrides the cache
851851
         # module's 10 GiB default. Pre-v9 docs inherit the default via
852852
         # the CacheConfig factory.
853
-        cache = TokenizedCache.open(
854
-            store.tokenized_cache_dir, max_bytes=training.cache.max_bytes
855
-        )
853
+        cache = TokenizedCache.open(store.tokenized_cache_dir, max_bytes=training.cache.max_bytes)
856854
         seq_len = training.sequence_len
857855
 
858856
         train_rows = [dict(r) for r in train_ds]
tests/unit/cli/test_cache_prune_frontmatter_default.pymodified
@@ -18,17 +18,11 @@ from dlm.cli.app import app
1818
 def _write_doc(path: Path, *, prune_days: int | None = None) -> None:
1919
     cache_block = ""
2020
     if prune_days is not None:
21
-        cache_block = (
22
-            "training:\n"
23
-            "  cache:\n"
24
-            f"    prune_older_than_days: {prune_days}\n"
25
-        )
21
+        cache_block = f"training:\n  cache:\n    prune_older_than_days: {prune_days}\n"
2622
     path.write_text(
2723
         "---\n"
2824
         "dlm_id: 01KPQ9PRNE" + "0" * 16 + "\n"
29
-        "base_model: smollm2-135m\n"
30
-        + cache_block
31
-        + "---\n"
25
+        "base_model: smollm2-135m\n" + cache_block + "---\n"
3226
         "body\n",
3327
         encoding="utf-8",
3428
     )
tests/unit/cli/test_show_cache_config.pymodified
@@ -21,11 +21,8 @@ def _write_doc(path: Path, *, enabled: bool | None = None, max_bytes: int | None
2121
             cache_lines.append(f"    max_bytes: {max_bytes}")
2222
     body = "\n".join(cache_lines) + ("\n" if cache_lines else "")
2323
     path.write_text(
24
-        "---\n"
25
-        "dlm_id: 01KPQ9SHWCACHE00000000000000"[:33] + "\n"
26
-        "base_model: smollm2-135m\n"
27
-        + body
28
-        + "---\n"
24
+        "---\ndlm_id: 01KPQ9SHWCACHE00000000000000"[:33] + "\n"
25
+        "base_model: smollm2-135m\n" + body + "---\n"
2926
         "body\n",
3027
         encoding="utf-8",
3128
     )
@@ -46,11 +43,7 @@ def test_json_reports_cache_config_defaults(tmp_path: Path) -> None:
4643
     `training_cache_config`."""
4744
     doc = tmp_path / "doc.dlm"
4845
     doc.write_text(
49
-        "---\n"
50
-        "dlm_id: 01KPQ9SHWCACHE000000000000\n"
51
-        "base_model: smollm2-135m\n"
52
-        "---\n"
53
-        "body\n",
46
+        "---\ndlm_id: 01KPQ9SHWCACHE000000000000\nbase_model: smollm2-135m\n---\nbody\n",
5447
         encoding="utf-8",
5548
     )
5649
 
@@ -97,11 +90,7 @@ def test_cache_config_present_even_without_store(tmp_path: Path) -> None:
9790
     not derived from on-disk state."""
9891
     doc = tmp_path / "doc.dlm"
9992
     doc.write_text(
100
-        "---\n"
101
-        "dlm_id: 01KPQ9SHWCACHE000000000000\n"
102
-        "base_model: smollm2-135m\n"
103
-        "---\n"
104
-        "body\n",
93
+        "---\ndlm_id: 01KPQ9SHWCACHE000000000000\nbase_model: smollm2-135m\n---\nbody\n",
10594
         encoding="utf-8",
10695
     )
10796