Skip to content

Commit 202364b

Browse files
danielkivclaude
andcommitted
Apply ruff format to existing source files
One-time formatting pass to bring all files in line with ruff's formatter, which is now enforced in CI and via pre-commit. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent b2a30c8 commit 202364b

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

src/rs_embed/pipelines/inference.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,11 @@ def _get_input(i: int, _ctx=ctx, _mc=mc) -> np.ndarray:
392392
def _single(i: int, _ctx=ctx, _mc=mc) -> Embedding:
393393
inp = _get_input(i) if _ctx.needs_provider_input else None
394394
fmeta = None
395-
if _ctx.needs_provider_input and _ctx.skey is not None and prefetch_meta is not None:
395+
if (
396+
_ctx.needs_provider_input
397+
and _ctx.skey is not None
398+
and prefetch_meta is not None
399+
):
396400
fmeta = prefetch_meta.get((i, _ctx.skey)) or None
397401
return self.infer_single(
398402
embedder=_ctx.embedder,

src/rs_embed/providers/prefetch_plan.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,7 @@ def select_prefetched_channels(x_chw: np.ndarray, idx: tuple[int, ...]) -> np.nd
4040
if len(idx) == x.shape[1] and all(i == j for j, i in enumerate(idx)):
4141
return x
4242
return x[:, list(idx), :, :]
43-
raise ValueError(
44-
f"Prefetched input must be CHW or TCHW, got shape={getattr(x, 'shape', None)}"
45-
)
43+
raise ValueError(f"Prefetched input must be CHW or TCHW, got shape={getattr(x, 'shape', None)}")
4644

4745

4846
def build_prefetch_plan(

src/rs_embed/tools/export_requests.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ def normalize_export_target(
5656
raise ModelError(f"Unsupported ExportTarget layout: {target.layout!r}.")
5757

5858

59-
6059
def resolve_export_model_configs(
6160
*,
6261
models: list[str | ExportModelRequest],

src/rs_embed/tools/model_defaults.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ def apply_fetch_to_sensor(sensor: SensorSpec, fetch: FetchSpec | None) -> Sensor
7272
return sensor
7373
return replace(sensor, **updates)
7474

75+
7576
def _fetch_override_sensor_for_model(model_id: str) -> SensorSpec | None:
7677
model_key = str(model_id).strip().lower()
7778
if model_key == "gse":

src/rs_embed/tools/normalization.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,7 @@ def normalize_input_array(
5757
f"{name} must be CHW or TCHW with ndim=3/4, got shape={getattr(x, 'shape', None)}"
5858
)
5959
if expected_channels is not None and c != int(expected_channels):
60-
raise ModelError(
61-
f"{name} channel mismatch: got C={c}, expected C={int(expected_channels)}"
62-
)
60+
raise ModelError(f"{name} channel mismatch: got C={c}, expected C={int(expected_channels)}")
6361
return x
6462

6563

0 commit comments

Comments
 (0)