Fix formatting drift
Authored by
mfwolffe <wolffemf@dukes.jmu.edu>
- SHA
e56a0ccecea08bbe6851b17d422d97db6886f2d2- Parents
-
3b03508 - Tree
cd43167
e56a0cc
e56a0ccecea08bbe6851b17d422d97db6886f2d23b03508
cd43167| Status | File | + | - |
|---|---|---|---|
| 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]: | ||
| 205 | 205 | gate. Empty list when no run has gate-event rows yet.""" |
| 206 | 206 | try: |
| 207 | 207 | 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() | |
| 211 | 209 | except sqlite3.Error: |
| 212 | 210 | return [] |
| 213 | 211 | 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 | ||
| 850 | 850 | # Sprint 31.6: `training.cache.max_bytes` overrides the cache |
| 851 | 851 | # module's 10 GiB default. Pre-v9 docs inherit the default via |
| 852 | 852 | # 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) | |
| 856 | 854 | seq_len = training.sequence_len |
| 857 | 855 | |
| 858 | 856 | 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 | ||
| 18 | 18 | def _write_doc(path: Path, *, prune_days: int | None = None) -> None: |
| 19 | 19 | cache_block = "" |
| 20 | 20 | 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" | |
| 26 | 22 | path.write_text( |
| 27 | 23 | "---\n" |
| 28 | 24 | "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" | |
| 32 | 26 | "body\n", |
| 33 | 27 | encoding="utf-8", |
| 34 | 28 | ) |
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 | ||
| 21 | 21 | cache_lines.append(f" max_bytes: {max_bytes}") |
| 22 | 22 | body = "\n".join(cache_lines) + ("\n" if cache_lines else "") |
| 23 | 23 | 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" | |
| 29 | 26 | "body\n", |
| 30 | 27 | encoding="utf-8", |
| 31 | 28 | ) |
@@ -46,11 +43,7 @@ def test_json_reports_cache_config_defaults(tmp_path: Path) -> None: | ||
| 46 | 43 | `training_cache_config`.""" |
| 47 | 44 | doc = tmp_path / "doc.dlm" |
| 48 | 45 | 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", | |
| 54 | 47 | encoding="utf-8", |
| 55 | 48 | ) |
| 56 | 49 | |
@@ -97,11 +90,7 @@ def test_cache_config_present_even_without_store(tmp_path: Path) -> None: | ||
| 97 | 90 | not derived from on-disk state.""" |
| 98 | 91 | doc = tmp_path / "doc.dlm" |
| 99 | 92 | 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", | |
| 105 | 94 | encoding="utf-8", |
| 106 | 95 | ) |
| 107 | 96 | |