Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

API — Time Series

TimeSeriesInfo

Metadata for a single time series attached to a component.

FieldTypeDescription
component_typestrComponent class name (e.g. "DistributionLoad")
component_namestrComponent instance name
variable_namestrTime series variable (e.g. "active_power", "irradiance")
lengthintNumber of timesteps
resolutiontimedelta | NoneDuration between timesteps
initial_timestampdatetime | NoneTimestamp of first data point
unitsstrUnit string (e.g. "kilowatt")

BatterySOCTracker

Tracks battery state-of-charge across QSTS timesteps with efficiency and SOC limits.

FieldTypeDefaultDescription
namestrBattery component name
energy_capacity_whfloatTotal energy capacity (Wh)
p_charge_max_wfloatMaximum charging power (W)
p_discharge_max_wfloatMaximum discharging power (W)
socfloat0.5Current state of charge (0–1)
soc_minfloat0.1Minimum SOC
soc_maxfloat0.9Maximum SOC
charge_efficiencyfloat0.95Charging efficiency
discharge_efficiencyfloat0.95Discharging efficiency

Methods:

QSTSSummary

Return type for completed QSTS simulations.

FieldTypeDescription
solverstrSolver used
num_timestepsintTotal timesteps simulated
num_convergedintNumber that converged
resolutiontimedeltaTimestep duration
initial_timestampdatetime | NoneFirst timestamp
db_pathstr | NoneSQLite database path
run_idstr | NoneUnique run identifier
battery_soc_tracesdict[str, list[float]]Battery SOC histories

Discovery Functions

list_component_time_series(system)

Discover all time series on loads, solar, and batteries.

Returns: dict[str, list[TimeSeriesInfo]] — keyed by component type name.

has_time_series_data(system)

Check if any component has time series. Returns: bool.

get_time_series_length(system)

Return minimum timestep count across all time series. Raises ValueError if none found.

get_time_series_resolution(system)

Return time series resolution. Raises ValueError if none found.

get_time_series_timestamps(system)

Return array of datetime64 timestamps.

Per-Timestep Extractors

build_nodal_power_specs_at_timestep(system, t_idx, ...)

Build AC-convention nodal P/Q specs at timestep t_idx. Positive = generation, negative = load.

Returns: (dict[BusPhaseLabel, float], dict[BusPhaseLabel, float])(p_spec_w, q_spec_var)

build_dc_load_profile_at_timestep(system, t_idx, ...)

Build DC demand profile at timestep t_idx. Positive = demand.

Returns: dict[BusPhaseLabel, float]

build_lindistflow_injections_at_timestep(system, t_idx, ...)

Build LinDistFlow net injections at timestep t_idx. Positive = demand, negative = injection.

Returns: (dict[BusPhaseLabel, float], dict[BusPhaseLabel, float])(p_net_w, q_net_var)

QSTS Orchestrator

run_qsts(system, solver, timestep_range, *, db_path=None, ...)

Run Quasi-Static Time Series simulation.

Parameters:

ParameterTypeDefaultDescription
systemDistributionSystemInput system with time series
solverstr"ac", "pf", "dc", or "ldf"
timestep_rangerangeTimestep indices to simulate
db_pathstr | NoneNoneSQLite path for streaming results
progress_callbackcallable | NoneNoneCalled with (done, total)

Returns: QSTSSummary