sweep.recover_sweep_results
sweep.recover_sweep_results(
cli,
job_set,
registry,
*,
run_ids,
export_type='patch',
quiet=False,
load_config=None,
)Load CSV results from completed sweep jobs into the registry.
Uses inspect_exports() to discover export path templates from the Josh file, then resolves template variables for each job’s parameters, custom_tags, and replicates.
This is a convenience wrapper around load_job_results() for batch loading.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| cli | JoshCLI | JoshCLI instance (needed for inspect_exports). | required |
| job_set | JobSet | The expanded jobs to collect results for. | required |
| registry | RunRegistry | Registry to load results into. | required |
| run_ids | dict[str, str] | Mapping of run_hash to run_id. Each job’s cell_data is attributed to the run_id for its run_hash. Obtain from SweepResult.run_ids after calling run_sweep(). | required |
| export_type | str | Type of export to load (“patch”, “meta”, “entity”). | 'patch' |
| quiet | bool | Suppress progress output. | False |
| load_config | LoadConfig | None | Retry and timing configuration. Uses defaults if None. | None |
Returns
| Name | Type | Description |
|---|---|---|
| int | Total number of rows loaded. |
Raises
| Name | Type | Description |
|---|---|---|
| ValueError | If jobs have different source_paths or no source_path. | |
| RuntimeError | If no export path configured for export_type. | |
| ResultLoadError | If load_config.raise_on_missing=True and loading fails. |
Examples
>>> from joshpy.sweep import recover_sweep_results
>>> rows = recover_sweep_results(
... cli=cli,
... job_set=job_set,
... registry=registry,
... export_type="patch",
... )
>>> print(f"Loaded {rows} rows from completed jobs")>>> # With retry configuration
>>> from joshpy.sweep import LoadConfig
>>> config = LoadConfig(max_retries=5, settle_delay=0.5)
>>> rows = recover_sweep_results(cli, job_set, registry, load_config=config)