Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature 562 export storage units #565

Merged
merged 9 commits into from
Sep 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion docs/advanced.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
3 changes: 2 additions & 1 deletion open_mastr/mastr.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand Down Expand Up @@ -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.
Expand Down
13 changes: 10 additions & 3 deletions open_mastr/utils/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"deleted_units",
"retrofit_units",
"changed_dso_assignment",
"storage_units",
]

# Possible values for parameter 'data' with API download method
Expand Down Expand Up @@ -64,6 +65,7 @@
"deleted_units",
"retrofit_units",
"changed_dso_assignment",
"storage_units",
]

# Possible data types for API download
Expand All @@ -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"],
Expand All @@ -89,7 +91,8 @@
],
"combustion": ["anlagenkwk", "einheitenverbrennung"],
"nuclear": ["einheitenkernkraft"],
"storage": ["anlageneegspeicher", "anlagenstromspeicher", "einheitenstromspeicher"],
"storage": ["anlageneegspeicher", "einheitenstromspeicher"],
"storage_units": ["anlagenstromspeicher"],
"gas": [
"anlagengasspeicher",
"einheitengaserzeuger",
Expand Down Expand Up @@ -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",
Expand All @@ -181,6 +187,7 @@
"deleted_units": "DeletedUnits",
"retrofit_units": "RetrofitUnits",
"changed_dso_assignment": "ChangedDSOAssignment",
"storage_units": "StorageUnits",
}

UNIT_TYPE_MAP = {
Expand Down
2 changes: 1 addition & 1 deletion open_mastr/utils/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
)

Expand Down