Batch Runner
BatchRunner is a client-side orchestration helper for submitting many energy model runs and waiting for all of them to complete. It wraps client.energy_models.create() for submission and client.tasks.get() for lightweight status polling.
When to Use
UseBatchRunner when you need to run multiple energy models (e.g. different sites, tracker vs fixed comparisons, sensitivity sweeps) and want to avoid writing your own submit/poll loop.
For a single run, use client.energy_models.create() and client.tasks.get() directly — see Usage Patterns.
Quick Start
Constructor
Methods
submit
Returns the API response dict containing
task_id, energy_model_id, and run_index.
submit_many
Returns the number of successfully submitted runs. Failed submissions are logged and skipped.
poll
GET /tasks/{task_id} for each non-terminal run and update statuses in-place. Returns a tuple of (completed, failed, pending) counts.
wait
Returns
True if all runs finished, False if timed out.
summary
results
GET /energymodels/{id} for every completed run. Returns a list of dicts:
results() makes one API call per completed run. Call it after wait() completes
to avoid fetching partial results.Properties
Logging
BatchRunner uses Python’s logging module (logger name: dalysdk.batch). To see progress output:
