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

add instructions on how to execute the data preparation #125

Draft
wants to merge 1 commit into
base: dev
Choose a base branch
from
Draft
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
18 changes: 15 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Please navigate to the section of interest to find out more.
* [License](#license)

## Introduction
*POMMES* itself is a cosmos consisting of a **dispatch model**, a **data preparation routine** (stored in this repository and described here) and an **investment model** for the German wholesale power market. The model was originally developed by a group of researchers and students at the [chair of Energy and Resources Management of TU Berlin](https://www.er.tu-berlin.de/menue/home/) and is now maintained by a group of alumni and open for other contributions.
*POMMES* itself is a cosmos consisting of a [**dispatch model**](https://github.com/pommes-public/pommesdispatch/), a **data preparation routine** (stored in this repository and described here) and an [**investment model**](https://github.com/pommes-public/pommesinvest) for the German wholesale power market. The model was originally developed by a group of researchers and students at the [chair of Energy and Resources Management of TU Berlin](https://www.er.tu-berlin.de/menue/home/) and is now maintained by a group of alumni and open for other contributions.

If you are interested in the actual dispatch or investment model, please find more information here:
- [pommesdispatch](https://github.com/pommes-public/pommesdispatch): A bottom-up fundamental power market model for the German electricity sector
Expand All @@ -23,8 +23,6 @@ If you are interested in the actual dispatch or investment model, please find mo
## Documentation
The data preparation is mainly carried out in this **[jupyter notebook](https://github.com/pommes-public/pommesdata/blob/dev/pommesdata/data_preparation.ipynb)**.
The data sources used as well as the calculation and transformation steps applied are described in a transparent manner.
In addition to that, there is a **[documentation of pommesdata](https://pommesdata.readthedocs.io/)** on readthedocs.
This in turn contains a documentation of the functions and classes used for data preparation.

## Installation and usage
There are **two use cases** for using `pommesdata`:
Expand Down Expand Up @@ -56,6 +54,20 @@ Activate your environment by typing
conda activate pommes_data
```

Create the result folder:

`mkdir prepared_data`

Download the when2heat.csv file from here:

`wget -O raw_data_input/timeseries/when2heat.csv https://data.open-power-system-data.org/when2heat/2022-02-22/when2heat.csv`

Switch to the pommesdata directory:

`cd pommesdata`

And execute the `data_preparation.ipynb` in jupyterlab or vscode with your newly created conda environment.

## Contributing
Every kind of contribution or feedback is warmly welcome.<br>
We use the GitHub issue management as well as pull requests for collaboration.
Expand Down
4 changes: 2 additions & 2 deletions pommesdata/data_prep/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ def load_entsoe_generation_data(
end="2017-12-31 23:45:00",
freq="15min",
)
df = df.resample("H").mean()
df = df.resample("H").mean(numeric_only=True)

elif len(df) == 8760 + 1:
df.drop(
Expand Down Expand Up @@ -344,7 +344,7 @@ def load_entsoe_german_generation_data(
end=f"{year}-12-31 23:45:00",
freq="15min",
)
generation = generation.resample("H").mean()
generation = generation.resample("H").mean(numeric_only=True)

generation = generation[
[
Expand Down
2 changes: 1 addition & 1 deletion pommesdata/data_preparation.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -1225,7 +1225,7 @@
"conv_de_new.loc[:,['country_geographical', 'country']] = 'DE'\n",
"conv_de_new['status'] = 'operating'\n",
"conv_de_new['eeg'] = 'no'\n",
"conv_de_new['commissioned_last'] = conv_de_new['commissioned'].astype(int)"
"conv_de_new['commissioned_last'] = conv_de_new['commissioned'].fillna(0).astype(int)"
]
},
{
Expand Down