sdom.export_results#
- sdom.export_results(results, case: str, output_dir: str = './results_pyomo/')[source]#
Export optimization results to CSV files.
Writes the results from an OptimizationResults object to CSV files in the specified directory. Creates output directory if it doesn’t exist.
- Parameters:
results (OptimizationResults) – The optimization results object from run_solver().
case (str or int) – Case identifier used in output filenames to distinguish between different scenarios or runs.
output_dir (str, optional) – Directory path for output files. Defaults to ‘./results_pyomo/’. Directory will be created if it doesn’t exist.
- Returns:
None
Output Files
————
OutputGeneration_{case}.csv – Hourly dispatch results containing: Scenario, Hour, Solar PV/Wind generation and curtailment, Thermal, hydro, nuclear, other renewables generation, Storage net charge/discharge, imports, exports, Load.
OutputStorage_{case}.csv – Hourly storage operation for each technology: Hour, Technology, Charging power (MW), Discharging power (MW), State of charge (MWh).
OutputSummary_{case}.csv – Summary metrics including: Total costs, Installed capacities by technology, Total generation by technology, Demand statistics, Cost breakdowns (VRE, storage, thermal CAPEX/FOM/VOM).
OutputThermalGeneration_{case}.csv – Disaggregated hourly thermal generation by plant (only if more than one thermal plant exists).
Notes
This function accepts either an OptimizationResults dataclass (new API) or the legacy tuple return from run_solver (deprecated).