breos.io#
I/O module for data export and import.
This module provides functions for: - Exporting simulation results to CSV/TXT - Saving cost analysis reports - Generating formatted summary reports
Functions
|
Export cost projection analysis to CSV or TXT. |
|
Export monthly aggregated summary to CSV. |
|
Export simulation results to CSV or TXT. |
|
Export summary statistics as formatted text or CSV. |
|
Export yearly aggregated summary to CSV. |
|
Load simulation results from CSV or TXT file. |
|
Save complete simulation report with all outputs. |
- breos.io.export_cost_analysis(cost_df, results_directory, prefix='', suffix='', format='csv', index=False)[source]#
Export cost projection analysis to CSV or TXT.
- Parameters:
cost_df (
DataFrame) – DataFrame from cost_analysis_projection()results_directory (
str) – Directory to save the fileprefix (
str) – Optional prefix for filenamesuffix (
str) – Optional suffix for filenameformat (
str) – Output format (‘csv’ or ‘txt’)index (
bool) – Whether to include DataFrame index
- Return type:
- Returns:
Path to the saved file
- breos.io.export_monthly_summary(results_df, results_directory, prefix='', suffix='')[source]#
Export monthly aggregated summary to CSV.
- breos.io.export_results(results_df, results_directory, prefix='', suffix='', format='csv', index=False)[source]#
Export simulation results to CSV or TXT.
- Parameters:
- Return type:
- Returns:
Path to the saved file
- breos.io.export_summary(summary_df, results_directory, prefix='', suffix='', format='txt', extra_metrics=None)[source]#
Export summary statistics as formatted text or CSV.
- Parameters:
summary_df (
DataFrame) – Summary DataFrame (typically single row with key metrics)results_directory (
str) – Directory to save the fileprefix (
str) – Optional prefix for filenamesuffix (
str) – Optional suffix for filenameformat (
str) – Output format (‘txt’ for formatted text, ‘csv’ for raw)extra_metrics (
Optional[Dict[str,Any]]) – Optional label -> value pairs appended as additional summary fields (e.g.{"LCOE [EUR/kWh]": "0.1327"}). Pre-format float values as strings to control their displayed precision.
- Return type:
- Returns:
Path to the saved file
- breos.io.export_yearly_summary(results_df, results_directory, prefix='', suffix='')[source]#
Export yearly aggregated summary to CSV.
- breos.io.load_results(filepath, parse_dates=True)[source]#
Load simulation results from CSV or TXT file.
- breos.io.save_simulation_report(results_df, summary_df, costs_dict=None, cost_projection_df=None, degradation_df=None, results_directory='results', scenario_name='', economics_metrics=None)[source]#
Save complete simulation report with all outputs.
Generates these files:
results_{scenario}.csv: full simulation time series.summary_{scenario}.txt: key metrics summary, including LCOE, payback, and NPV when a cost projection is provided.costs_{scenario}.csv: cost analysis, if provided.degradation_{scenario}.csv: battery degradation data, if provided.
- Parameters:
results_df (
DataFrame) – Full simulation results DataFramesummary_df (
DataFrame) – Summary statistics DataFramecosts_dict (
Optional[Dict[str,Any]]) – Optional cost parameters dictionarycost_projection_df (
Optional[DataFrame]) – Optional cost projection DataFramedegradation_df (
Optional[DataFrame]) – Optional degradation tracking DataFrameresults_directory (
str) – Directory to save all filesscenario_name (
str) – Scenario identifier for filenameseconomics_metrics (
Optional[Dict[str,Any]]) – Optional label -> value pairs added to the summary, overriding any figures auto-derived fromcost_projection_df.
- Return type:
- Returns:
Dictionary mapping file types to saved file paths