analysis¶
Offline, dependency-free views of a sweep directory. Each reads the per-cell
status and metrics sidecars directly (no Hydra composition or xarray), so they
load instantly and work mid-sweep; show also reads the sweep's
multirun.yaml for the latest run's progress. See the
exploration → paper guide for how they fit an
exploration workflow.
show ¶
Read the sweep under root and return a status/metrics table.
A cell's status is completed, failed, skipped (left out
by sample=, or by a max_total_seconds budget that ran out),
running (started; also a cell whose process was killed), or, on
mushin's submitit launchers, queued: its job was submitted and has
not started. A cell sent to a job again (by a resume) is queued in
place of its earlier record until the job starts. Without a submitit
launcher, a cell that has not started has no row.
queued comes from the launch files under root/mushin_jobs/,
which a driver removes once it has waited on the jobs. A driver killed
before then leaves its file, and the cells of a SLURM job that never
started stay queued until a later run records them (a local one's,
until its processes have exited). A launch of cells whose dirs nest
below root (a hydra.sweep.subdir of several levels) lists none.
After the table, show prints the latest run's progress (its
SweepProgress, also returned as .progress), for example::
run 3f2a9c1e, started 2026-11-29 10:02 UTC: 12 of 24 cells done
(11 completed, 1 failed), 2 running, 10 not started; 4 rows are
from earlier runs; not finished
(one line). The latest run is the one root/multirun.yaml names,
which each run(), a resume included, rewrites when it launches.
Only its own cells are counted: rows an earlier run left in a reused
working_dir stay in the table, as earlier. finished says
whether the run ended and wrote its manifest. A directory whose
multirun.yaml names no run (missing, or from before runs were
named) prints no progress line.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
root
|
A sweep |
required | |
metrics
|
list[str] | None
|
Restrict the metric columns to these names, in this order (default:
every metric found, discovery order). An unknown name raises
|
None
|
sort
|
str | None
|
Column to sort rows by (a swept param, |
None
|
jobs
|
bool
|
Add the columns |
False
|
Returns:
| Type | Description |
|---|---|
ShowResult
|
|
best ¶
Return the completed cell that optimizes metric across the sweep, or,
with over=, the configuration whose mean metric over the named
swept params is best.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
root
|
A sweep |
required | |
metric
|
str
|
The metric to optimize; it must be a finite scalar in each cell. |
required |
mode
|
str
|
|
'max'
|
over
|
str | Sequence[str] | None
|
Swept params to average over, typically |
None
|
Returns:
| Type | Description |
|---|---|
BestResult
|
With |
Raises:
| Type | Description |
|---|---|
ValueError
|
If |
FileNotFoundError
|
If |
diff ¶
Compare two sweep directories a and b.
Cells are aligned by their swept-param combination. For each shared cell the
delta b - a is computed for every metric that is a finite scalar in both,
and only when the cell is completed on BOTH sides (a failed/skipped
cell may carry a stale sidecar from a prior attempt; its row appears with
empty deltas). Cells present in only one sweep are reported separately,
along with a diff of the two runs' environment provenance
(git/packages/python, and the accelerator when both runs recorded one).
Returns:
| Type | Description |
|---|---|
DiffResult
|
|
table ¶
Export a sweep's cells as CSV: one row per cell with its swept params,
status, and metrics.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
root
|
A sweep |
required | |
path
|
If given, write the CSV there, in UTF-8 on every platform, and return
the |
None
|
|
metrics
|
list[str] | None
|
Restrict the metric columns to these names, in this order (default:
every metric found, discovery order); repeats are deduplicated. A
metric sharing a swept param's name, or |
None
|
Raises:
| Type | Description |
|---|---|
FileNotFoundError
|
If |
ValueError
|
If |