Skip to content

Commit b792a14

Browse files
committed
style: Format files with ruff
1 parent 3859c65 commit b792a14

3 files changed

Lines changed: 6 additions & 18 deletions

File tree

src/ctrlmap/llm/client.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -417,9 +417,7 @@ async def evaluate_chunks_batch_async(
417417
template = load_prompt("batch_evaluation.txt")
418418

419419
# Build numbered chunk listing
420-
numbered_chunks = "\n".join(
421-
f"### Chunk {i}\n{text}" for i, text in enumerate(chunk_texts)
422-
)
420+
numbered_chunks = "\n".join(f"### Chunk {i}\n{text}" for i, text in enumerate(chunk_texts))
423421

424422
prompt = template.format(
425423
control_text=control_text,

src/ctrlmap/map/enrichment.py

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,7 @@ async def _enrich_async(
123123
_process_one_control(r, llm_client, fast_client, semaphore) for r in results
124124
]
125125
meta_flags = await asyncio.gather(*per_control_tasks)
126-
console.print(
127-
f"[dim] Step 1+2 (evaluate + classify): {time.monotonic() - t0:.1f}s[/]"
128-
)
126+
console.print(f"[dim] Step 1+2 (evaluate + classify): {time.monotonic() - t0:.1f}s[/]")
129127

130128
meta_ids = {results[i].control.control_id for i, is_meta in enumerate(meta_flags) if is_meta}
131129

@@ -137,21 +135,15 @@ async def _enrich_async(
137135
f"[bold blue]LLM:[/] Generating {gap_count} gap rationales ({DEFAULT_FAST_MODEL})..."
138136
)
139137
await _step_generate_gaps(results, fast_client, semaphore)
140-
console.print(
141-
f"[dim] Step 3 (gap rationales): {time.monotonic() - t1:.1f}s[/]"
142-
)
138+
console.print(f"[dim] Step 3 (gap rationales): {time.monotonic() - t1:.1f}s[/]")
143139

144140
# Step 4: Resolve meta-requirements via sibling aggregation (no LLM)
145141
t2 = time.monotonic()
146142
console.print("[bold blue]LLM:[/] Resolving meta-requirements...")
147143
resolved = resolve_meta_requirements(results=results, meta_control_ids=meta_ids)
148-
console.print(
149-
f"[dim] Step 4 (meta-resolution): {time.monotonic() - t2:.1f}s[/]"
150-
)
144+
console.print(f"[dim] Step 4 (meta-resolution): {time.monotonic() - t2:.1f}s[/]")
151145

152-
console.print(
153-
f"[bold green]Pipeline total:[/] {time.monotonic() - pipeline_start:.1f}s"
154-
)
146+
console.print(f"[bold green]Pipeline total:[/] {time.monotonic() - pipeline_start:.1f}s")
155147

156148
if cache is not None:
157149
stats = cache.stats()

tests/unit/test_ollama_client.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -594,9 +594,7 @@ async def test_evaluate_chunks_batch_async_falls_back_on_invalid_json(self) -> N
594594
with patch("ctrlmap.llm.client.ollama.AsyncClient") as mock_async_cls:
595595
mock_instance = MagicMock()
596596
mock_instance.chat = AsyncMock(
597-
return_value=MagicMock(
598-
message=MagicMock(content="This is not valid JSON at all")
599-
)
597+
return_value=MagicMock(message=MagicMock(content="This is not valid JSON at all"))
600598
)
601599
mock_async_cls.return_value = mock_instance
602600

0 commit comments

Comments
 (0)