From fa1c51637d3a69ed473e36c7585b1cbbe960a006 Mon Sep 17 00:00:00 2001 From: nesnoj Date: Tue, 17 Sep 2024 15:14:55 +0200 Subject: [PATCH 1/9] Allow CSV export of storage_units #562 --- open_mastr/mastr.py | 2 +- open_mastr/utils/constants.py | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/open_mastr/mastr.py b/open_mastr/mastr.py index acd626b8..ca4ff91d 100644 --- a/open_mastr/mastr.py +++ b/open_mastr/mastr.py @@ -304,7 +304,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..80bb2307 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 @@ -181,6 +183,7 @@ "deleted_units": "DeletedUnits", "retrofit_units": "RetrofitUnits", "changed_dso_assignment": "ChangedDSOAssignment", + "storage_units": "StorageUnits", } UNIT_TYPE_MAP = { From 5171ff1c12c8cc4fc762a2ecdf42f5b7c23b22b6 Mon Sep 17 00:00:00 2001 From: nesnoj Date: Tue, 17 Sep 2024 15:15:21 +0200 Subject: [PATCH 2/9] Fix some typos and formatting --- docs/advanced.md | 2 +- open_mastr/utils/constants.py | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) 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/utils/constants.py b/open_mastr/utils/constants.py index 80bb2307..8405f54a 100644 --- a/open_mastr/utils/constants.py +++ b/open_mastr/utils/constants.py @@ -162,7 +162,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", From 8a026daa0368597d37ad85320e048fcd234324b6 Mon Sep 17 00:00:00 2001 From: nesnoj Date: Tue, 17 Sep 2024 15:20:58 +0200 Subject: [PATCH 3/9] Fix error message in CSV export --- open_mastr/utils/helpers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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}" ) From d95b1823baa21267ab8e0f31a9652313876d550d Mon Sep 17 00:00:00 2001 From: nesnoj Date: Tue, 17 Sep 2024 15:28:16 +0200 Subject: [PATCH 4/9] Update changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index cf2b2811..da080b24 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` + [#562](https://github.com/OpenEnergyPlatform/open-MaStR/issues/562) ### Removed ## [v0.14.4] Release for the Journal of Open Source Software JOSS - 2024-06-07 From 40ffd197fe4cb8789803375b7ec0c7b38ddc7daa Mon Sep 17 00:00:00 2001 From: nesnoj Date: Wed, 18 Sep 2024 13:33:51 +0200 Subject: [PATCH 5/9] Split mapping of bulk data to xml file names for storages #562 --- open_mastr/mastr.py | 1 + open_mastr/utils/constants.py | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/open_mastr/mastr.py b/open_mastr/mastr.py index ca4ff91d..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 | diff --git a/open_mastr/utils/constants.py b/open_mastr/utils/constants.py index 8405f54a..8bc85d58 100644 --- a/open_mastr/utils/constants.py +++ b/open_mastr/utils/constants.py @@ -91,7 +91,8 @@ ], "combustion": ["anlagenkwk", "einheitenverbrennung"], "nuclear": ["einheitenkernkraft"], - "storage": ["anlageneegspeicher", "anlagenstromspeicher", "einheitenstromspeicher"], + "storage": ["anlageneegspeicher", "einheitenstromspeicher"], + "storage_units": ["anlagenstromspeicher"], "gas": [ "anlagengasspeicher", "einheitengaserzeuger", From f76208111a101cac96e48f65f326b7699f3b4d10 Mon Sep 17 00:00:00 2001 From: nesnoj Date: Wed, 18 Sep 2024 16:18:52 +0200 Subject: [PATCH 6/9] Fix string to trigger test --- open_mastr/utils/constants.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/open_mastr/utils/constants.py b/open_mastr/utils/constants.py index 8bc85d58..88661fbf 100644 --- a/open_mastr/utils/constants.py +++ b/open_mastr/utils/constants.py @@ -79,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"], From 7d65140e68ec485b4c37265a249e230b5270896c Mon Sep 17 00:00:00 2001 From: nesnoj Date: Wed, 18 Sep 2024 16:40:12 +0200 Subject: [PATCH 7/9] Update changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index da080b24..0b75fbe3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,7 +18,7 @@ and the versioning aims to respect [Semantic Versioning](http://semver.org/spec/ - 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` - [#562](https://github.com/OpenEnergyPlatform/open-MaStR/issues/562) + [#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 From c678821b75f6db4a157b0f3c0b359ebf02cbec05 Mon Sep 17 00:00:00 2001 From: nesnoj Date: Wed, 18 Sep 2024 18:07:18 +0200 Subject: [PATCH 8/9] Change GH actions CI dev condition Add 'ready_for_review' --- .github/workflows/ci-develop.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-develop.yml b/.github/workflows/ci-develop.yml index 6a7a6457..560dac97 100644 --- a/.github/workflows/ci-develop.yml +++ b/.github/workflows/ci-develop.yml @@ -11,7 +11,7 @@ jobs: # Jobs definition runs-on: ${{ matrix.os }} - if: ${{ !github.event.pull_request.draft }} + if: ${{ (!github.event.pull_request.draft) || (github.event.pull_request.ready_for_review) }} strategy: matrix: os: [macos-latest, ubuntu-latest, windows-latest] From 0f7f6d998e5f323e0ecac7c6794bbbe480c25dd0 Mon Sep 17 00:00:00 2001 From: nesnoj Date: Wed, 18 Sep 2024 18:08:30 +0200 Subject: [PATCH 9/9] Revert "Change GH actions CI dev condition" This reverts commit c678821b75f6db4a157b0f3c0b359ebf02cbec05. --- .github/workflows/ci-develop.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-develop.yml b/.github/workflows/ci-develop.yml index 560dac97..6a7a6457 100644 --- a/.github/workflows/ci-develop.yml +++ b/.github/workflows/ci-develop.yml @@ -11,7 +11,7 @@ jobs: # Jobs definition runs-on: ${{ matrix.os }} - if: ${{ (!github.event.pull_request.draft) || (github.event.pull_request.ready_for_review) }} + if: ${{ !github.event.pull_request.draft }} strategy: matrix: os: [macos-latest, ubuntu-latest, windows-latest]