Netcdf Exporter¶
pyconvexity.io.netcdf_exporter
¶
NetCDF exporter for PyConvexity energy system models. Exports networks to PyPSA NetCDF format using existing PyPSA infrastructure.
NetCDFModelExporter
¶
Export network model to PyPSA NetCDF format
export_to_netcdf(db_path: str, output_path: str, scenario_id: Optional[int] = None, progress_callback: Optional[Callable[[int, str], None]] = None) -> Dict[str, Any]
¶
Export network from database to PyPSA NetCDF format (single network per database).
This method leverages the existing pyconvexity PyPSA infrastructure to build a network from the database and then export it to NetCDF format.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
db_path
|
str
|
Path to the database file |
required |
output_path
|
str
|
Path where to save the NetCDF file |
required |
scenario_id
|
Optional[int]
|
Optional scenario ID (NULL for base network) |
None
|
progress_callback
|
Optional[Callable[[int, str], None]]
|
Optional callback for progress updates |
None
|
Returns:
| Type | Description |
|---|---|
Dict[str, Any]
|
Dictionary with export results and statistics |
export_to_csv(db_path: str, output_directory: str, scenario_id: Optional[int] = None, progress_callback: Optional[Callable[[int, str], None]] = None) -> Dict[str, Any]
¶
Export network from database to PyPSA CSV format (single network per database).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
db_path
|
str
|
Path to the database file |
required |
output_directory
|
str
|
Directory where to save CSV files |
required |
scenario_id
|
Optional[int]
|
Optional scenario ID (NULL for base network) |
None
|
progress_callback
|
Optional[Callable[[int, str], None]]
|
Optional callback for progress updates |
None
|
Returns:
| Type | Description |
|---|---|
Dict[str, Any]
|
Dictionary with export results and statistics |