Skip to content

Commit a643f3f

Browse files
committed
style(trace): ruff format recommend.py — fix the CI lint gate
PR #5's lint was red on two ruff findings in recommend.py: manual column alignment ('df[_GPN] = ...') and one E501 (the widened keep={...} dict, 125>120). Pure formatting, no logic change.
1 parent 2b07e53 commit a643f3f

1 file changed

Lines changed: 19 additions & 5 deletions

File tree

src/coastline/sdk/trace/recommend.py

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,14 @@ def _recommend_row(
187187
Falls back to the legacy tps×runtime path only when tot_tokens_col is None.
188188
- ``note``: None on full success; otherwise the reason the row was kept unchanged.
189189
"""
190-
keep = {"nodes": row.get(_NODES), "gpn": row.get(_GPN), "batch": row.get(_BATCH), "thr": None, "dur": None, "note": None}
190+
keep = {
191+
"nodes": row.get(_NODES),
192+
"gpn": row.get(_GPN),
193+
"batch": row.get(_BATCH),
194+
"thr": None,
195+
"dur": None,
196+
"note": None,
197+
}
191198
tokens, batch = _as_int(row.get(tokens_col)), _as_int(row.get(_BATCH))
192199
gpn, nodes = _as_int(row.get(_GPN)), _as_int(row.get(_NODES))
193200
if not (tokens and batch and gpn and nodes):
@@ -238,7 +245,8 @@ def kavier_hint() -> str:
238245
# col was provided but this row has no value — warn but still write throughput
239246
logger.warning(
240247
"row (%s): tot_tokens_col '%s' is null — throughput written, duration skipped",
241-
row.get(_MODEL, "?"), tot_tokens_col,
248+
row.get(_MODEL, "?"),
249+
tot_tokens_col,
242250
)
243251
elif dur is None and tot_tokens_col is None:
244252
# legacy path: no output data available
@@ -307,8 +315,14 @@ def recommend_trace(
307315
df = pd.read_csv(input_csv, low_memory=False)
308316
recs = [
309317
_recommend_row(
310-
row, predictor, goal, feasibility, total_gpus, lookup,
311-
tokens_col=tokens_col, tot_tokens_col=tot_tokens_col,
318+
row,
319+
predictor,
320+
goal,
321+
feasibility,
322+
total_gpus,
323+
lookup,
324+
tokens_col=tokens_col,
325+
tot_tokens_col=tot_tokens_col,
312326
setup_time_col=setup_time_col,
313327
)
314328
for _, row in df.iterrows()
@@ -321,7 +335,7 @@ def recommend_trace(
321335
dur_col = f"metadata.estimated_duration_{method}"
322336

323337
df[_NODES] = [r["nodes"] for r in recs]
324-
df[_GPN] = [r["gpn"] for r in recs]
338+
df[_GPN] = [r["gpn"] for r in recs]
325339
df[_BATCH] = [r["batch"] for r in recs]
326340
df[thr_col] = [r["thr"] for r in recs]
327341
df[dur_col] = [r["dur"] for r in recs]

0 commit comments

Comments
 (0)