diff --git a/CHANGELOG.md b/CHANGELOG.md index cf2b2811..0b75fbe3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,8 @@ and the versioning aims to respect [Semantic Versioning](http://semver.org/spec/ [#553](https://github.com/OpenEnergyPlatform/open-MaStR/issues/553) - Allow to configure model/service port in `soap_api.download.MaStRAPI` [#556](https://github.com/OpenEnergyPlatform/open-MaStR/issues/556) +- Allow CSV export of table `storage_units` + [#565](https://github.com/OpenEnergyPlatform/open-MaStR/pull/565) ### Removed ## [v0.14.4] Release for the Journal of Open Source Software JOSS - 2024-06-07 diff --git a/docs/advanced.md b/docs/advanced.md index 052bc342..a0db651f 100644 --- a/docs/advanced.md +++ b/docs/advanced.md @@ -1,5 +1,5 @@ For most users, the functionalites described in [Getting Started](getting_started.md) are sufficient. If you want -to examine how you can configure the package's behavior for your own needs, check out [Cofiguration](#configuration). Or you can explore the two main functionalities of the package, namely the [Bulk Download](#bulk-download) +to examine how you can configure the package's behavior for your own needs, check out [Configuration](#configuration). Or you can explore the two main functionalities of the package, namely the [Bulk Download](#bulk-download) or the [SOAP API download](#soap-api-download). ## Configuration diff --git a/open_mastr/mastr.py b/open_mastr/mastr.py index acd626b8..47661c49 100644 --- a/open_mastr/mastr.py +++ b/open_mastr/mastr.py @@ -142,6 +142,7 @@ def download( | "nuclear" | Yes | Yes | | "gas" | Yes | Yes | | "storage" | Yes | Yes | + | "storage_units" | Yes | Yes | | "electricity_consumer"| Yes | No | | "location" | Yes | Yes | | "market" | Yes | No | @@ -304,7 +305,7 @@ def to_csv( "balancing_area", "electricity_consumer", "gas_consumer", "gas_producer", "gas_storage", "gas_storage_extended", "grid_connections", "grids", "market_actors", "market_roles", - "locations_extended, 'permit', 'deleted_units' ] + "locations_extended", "permit", "deleted_units", "storage_units"] chunksize: int Defines the chunksize of the tables export. Default value is 500.000 rows to include in each chunk. diff --git a/open_mastr/utils/constants.py b/open_mastr/utils/constants.py index 18afb2c0..88661fbf 100644 --- a/open_mastr/utils/constants.py +++ b/open_mastr/utils/constants.py @@ -18,6 +18,7 @@ "deleted_units", "retrofit_units", "changed_dso_assignment", + "storage_units", ] # Possible values for parameter 'data' with API download method @@ -64,6 +65,7 @@ "deleted_units", "retrofit_units", "changed_dso_assignment", + "storage_units", ] # Possible data types for API download @@ -77,7 +79,7 @@ "location_gas_consumption", ] -# Map bulk data to bulk download tables (xml file names) +# Map bulk data to bulk download tables (XML file names) BULK_INCLUDE_TABLES_MAP = { "wind": ["anlageneegwind", "einheitenwind"], "solar": ["anlageneegsolar", "einheitensolar"], @@ -89,7 +91,8 @@ ], "combustion": ["anlagenkwk", "einheitenverbrennung"], "nuclear": ["einheitenkernkraft"], - "storage": ["anlageneegspeicher", "anlagenstromspeicher", "einheitenstromspeicher"], + "storage": ["anlageneegspeicher", "einheitenstromspeicher"], + "storage_units": ["anlagenstromspeicher"], "gas": [ "anlagengasspeicher", "einheitengaserzeuger", @@ -160,7 +163,10 @@ "eeg_data": "HydroEeg", "permit_data": "Permit", }, - "nuclear": {"unit_data": "NuclearExtended", "permit_data": "Permit"}, + "nuclear": { + "unit_data": "NuclearExtended", + "permit_data": "Permit" + }, "storage": { "unit_data": "StorageExtended", "eeg_data": "StorageEeg", @@ -181,6 +187,7 @@ "deleted_units": "DeletedUnits", "retrofit_units": "RetrofitUnits", "changed_dso_assignment": "ChangedDSOAssignment", + "storage_units": "StorageUnits", } UNIT_TYPE_MAP = { diff --git a/open_mastr/utils/helpers.py b/open_mastr/utils/helpers.py index 1ac061bd..ad4f4dd8 100644 --- a/open_mastr/utils/helpers.py +++ b/open_mastr/utils/helpers.py @@ -222,7 +222,7 @@ def validate_parameter_data(method, data) -> None: ) if method == "csv_export" and value not in TECHNOLOGIES + ADDITIONAL_TABLES: raise ValueError( - "Allowed values for parameter data with API method are " + "Allowed values for CSV export are " f"{TECHNOLOGIES} or {ADDITIONAL_TABLES}" )