# nodus.sweep

> `Sweep`: one Job template run across a matrix of GPUs, regions and parameters (resources.md §3.3, ADR-051).

Source: https://nodus-platform-site.pages.dev/docs/reference/python/nodus-sweep/
Build revision: 211ad9f836655b1c3a2668c4693e442471f28614

<!-- Generated by scripts/gen-reference.mjs from the SDK docstrings (griffe). Do not edit: run make gen. -->

`Sweep`: one Job template run across a matrix of GPUs, regions and parameters (resources.md §3.3, ADR-051).

`Sweep(job_spec, grid={"gpu": ["H100", "L4"], "BATCH_SIZE": [8, 16]})` describes the matrix and `run()` creates it; each cell is a Job named `<sweep>-<index>` and the report lists cost, wall time and throughput per cell. The API serves Job templates, so a Function or a recipe as the target raises `errors.Unsupported`.

## `Sweep`

```python
class Sweep(target: Mapping[str, Any] | None = None, *, grid: Mapping[str, Iterable[Any] | str] | None = None, repetitions: int | None = None, max_parallel: int | None = None, max_cost: Any = None, name: str | None = None, labels: dict[str, str] | None = None, project: str | None = None) -> None
```

A Sweep: describe it, `run()` it, then read the report with `wait()`, `cells()` and `status()`.

### `Sweep.cancel`

```python
cancel() -> None
```

### `Sweep.cells`

```python
cells() -> list[View]
```

One entry per cell, in index order: GPU, region, parameters, phase, cost, wall time and throughput.

### `Sweep.estimate`

```python
estimate() -> View
```

The Sweep’s `status.estimate`: the total cost estimate over every cell.

### `Sweep.from_name`

```python
from_name(name: str, project: str | None = None) -> _Sweep
```

A Sweep that exists already, to wait on or read.

### `Sweep.jobs`

```python
jobs() -> list[View]
```

The cell Jobs the Sweep created.

### `Sweep.name`

Type: `str | None`

The Sweep’s name; a Sweep without one gets it from `run()`.

### `Sweep.resume`

```python
resume() -> None
```

### `Sweep.run`

```python
run(idempotency_key: str | None = None) -> _Sweep
```

Create the Sweep and return it; `.wait()` blocks until every cell is terminal.

### `Sweep.status`

```python
status() -> View
```

The Sweep’s `status`: phase, cells, best, cost and estimate.

### `Sweep.suspend`

```python
suspend() -> None
```

### `Sweep.wait`

```python
wait(timeout: float | None = None) -> View
```

Block until the Sweep is terminal and return its report (the `status`).

A Sweep with failed cells ends `Failed` with reason `CellsFailed` and still has its report, so only a timeout or a missing Sweep raises; read `phase` and `best` on the result.
