Skip to content

Commit

Permalink
Add: gitattributes and contributing files
Browse files Browse the repository at this point in the history
  • Loading branch information
evgenytsydenov authored Nov 25, 2022
2 parents 3ecceb8 + 8669492 commit 31754dd
Show file tree
Hide file tree
Showing 25 changed files with 2,558 additions and 657 deletions.
3 changes: 2 additions & 1 deletion .flake8
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[flake8]
max-line-length = 88
extend-ignore = E203,E402
extend-ignore = E203,E402,D100,D104
docstring-convention = google
per-file-ignores =
*/__init__.py: F401
11 changes: 11 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Set default behavior to automatically normalize line endings
* text=auto

# Denote all files that are truly binary and should not be modified
*.png binary
*.jpg binary
*.pdf binary
*.svg binary
*.doc binary
*.docx binary
*.xls binary
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,4 @@ repos:
rev: 4.0.1
hooks:
- id: flake8
additional_dependencies: [flake8-docstrings]
72 changes: 72 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# Contribution Guide

Everyone is welcome to contribute to this project. Feel free to share your ideas to improve the dataset and make it more valuable to the power engineering community.

## How to contribute

If you have found a bug or have a suggestion, please open [an issue](https://github.com/evgenytsydenov/ieee118_power_flow_data/issues) to discuss possible new developments with the community and developers.

If you can fix a problem or implement a new feature yourself, please read the following steps to learn how to submit your suggestions via pull requests:
1. Create a fork using the "Fork" button in the repository. This creates a copy of the code under your GitHub user account and allows you to freely experiment with changes without affecting the original project (see [GitHub docs](https://docs.github.com/en/get-started/quickstart/contributing-to-projects#forking-a-repository) for details).
2. Clone your fork to your local disk, and add the base repository as a remote:
```shell
$ git clone https://github.com/<YOUR_GITHUB_USERNAME>/ieee118_power_flow_data.git
$ cd ieee118_power_flow_data
$ git remote add upstream https://github.com/evgenytsydenov/ieee118_power_flow_data.git
```
3. Create a new branch to hold your development changes:
```shell
$ git checkout -b <BRANCH_NAME>
```
4. Set up a development environment using [poetry](https://python-poetry.org/docs/) by running the following command:
```shell
$ poetry install --with dev
```
or, if you prefer [pip](https://packaging.python.org/en/latest/guides/installing-using-pip-and-virtual-environments/), create and activate virtual environment, and run the following command:
```shell
$ pip install -r requirements-dev.txt
```
5. Develop on your branch. Please follow [the project considerations](#Project-considerations) listed below.
6. Once you finished developing, install pre-commit hooks:
```shell
$ pre-commit install
```
add changed files and make a commit to record your changes locally:
```shell
$ git add .
$ git commit -m "Add: commit message"
```
sync your code with the original repository:
```shell
$ git fetch upstream
$ git rebase upstream/main
```
push the changes to your account:
```shell
$ git push -u origin <BRANCH_NAME>
```
7. Go to the webpage of your fork on GitHub, choose your branch, click on "Pull request" to send your changes for review (see [GitHub docs](https://docs.github.com/en/get-started/quickstart/contributing-to-projects#making-a-pull-request) for details). The title of your pull request should be a summary of its contribution.
8. Your changes are now visible for everyone [on the Pull requests page](https://github.com/evgenytsydenov/ieee118_power_flow_data/pulls). We will review your pull request as soon as possible!

## Project considerations

1. Commit messages should have the following format: "\<tag>: \<message>", where \<tag> is one of "Add", "Update" or "Fix".
2. Branch names should be informative and [snake_case](https://en.wikipedia.org/wiki/Snake_case) formatted.
3. All methods and classes should be documented. We try to adhere by [the Google Python Style Guide](https://github.com/google/styleguide/blob/gh-pages/pyguide.md#38-comments-and-docstrings).
4. We use [PEP8](https://peps.python.org/pep-0008/) (with max line length equal to 88) and check that the code is formatted with [black](https://black.readthedocs.io/en/stable/index.html).


## Possible enhancements

Here is a list of topics that can be implemented to enhance the quality of the dataset (in descending order of priority):

1. Bus voltage limits can be set from the JEAS-118 dataset. Currently, these values are hardcoded as 0.8 and 1.2 for `min_v_pu` and `max_v_pu` respectively to achieve the convergence of the OPF estimation.
2. Min limits of active output of optimized generators are currently set to zero to achieve the convergence of the OPF estimation. These limits can be set according to the NREL-118 data.
3. Limits of reactive output of generators can be estimated more accurate with consideration of actual active output of generators. Currently, the limits are set from -0.3 to 0.7 of the max active output.
4. The cost function used for the OPF task can be composed and added to reflect the unit commitment process used in the industry. Currently, the default cost function from PandaPower is used which aims to minimize the total generation.
5. Branch outages can be added as time series to simulate emergency failures or maintenance during the year. At present, all branches are always in service.
6. The NREL-118 dataset contains a lot of generator parameters (fuel price, emission rate, start cost, up and down time, speed and cost of ramp up and down, etc.) that can be used to solve the OPF task in a more realistic way.
7. The JEAS-118 dataset contains information about angles of phase shifting transformers. These angles can be added to the power system model for more accurate transformer modeling.
8. Limits of slack bus injections can be added as time series for more realistic simulation of external grid behavior.
9. The `PLANT_MODE` parameter can be added to group generators per buses so that the power system model contains only one generator/plant per bus.
10. Memory consumption of parallel execution of OPF and PF (in workers) can be optimized by using [the shared memory](https://docs.python.org/3/library/multiprocessing.shared_memory.html).
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Power system data (model structure, time-series, plots, etc.) and power flow cas

To customize the pipeline or to build power flow cases manually:
1. Download the source code [from the latest release](https://github.com/evgenytsydenov/ieee118_power_flow_data/releases/latest) or [clone the repository](https://docs.github.com/en/repositories/creating-and-managing-repositories/cloning-a-repository).
2. Go to the project directory, create and activate a virtual environment, install project dependencies [with poetry](https://python-poetry.org/docs/basic-usage/#installing-dependencies) or [pip](https://packaging.python.org/en/latest/guides/installing-using-pip-and-virtual-environments/).
2. Go to the project directory, create and activate a virtual environment, install project dependencies [with pip](https://packaging.python.org/en/latest/guides/installing-using-pip-and-virtual-environments/) or use [poetry](https://python-poetry.org/docs/basic-usage/#installing-dependencies).
3. Add customizations or tune parameters that are listed [in definitions](definitions.py) and used in the computation.
4. Run `main.py` script in the activated environment. It is also possible to add the project directory to `PYTHONPATH` and run `dvc repro` in the terminal.
5. After completing all the stages, the power flow cases will be saved in the folder "samples" in the project directory.
Expand All @@ -54,7 +54,7 @@ To customize the pipeline or to build power flow cases manually:
This work is licensed under [Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License][license].


## Citing
## Citation

If you use the repository code or prepared dataset (power system data, power flow cases, plots, etc.) in your research, please cite the following BibTeX entry:
```
Expand All @@ -66,3 +66,8 @@ If you use the repository code or prepared dataset (power system data, power flo
url = {https://github.com/evgenytsydenov/ieee118_power_flow_data},
}
```


## Contribution

Everyone is welcome to contribute to this project. Feel free to share your ideas to improve the dataset and make it more valuable to the power engineering community. See [our Contribution Guide](CONTRIBUTING.md) for details.
Binary file modified data/raw/nrel118/plexos-export.xls
Binary file not shown.
62 changes: 31 additions & 31 deletions dvc.lock
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ stages:
deps:
- path: data/raw/nrel118/Input files/RT/Load
md5: 15de5344806c746934ee61dfb508704b.dir
size: 860632
size: 886987
nfiles: 4
- path: src/data/parse/nrel118_loads_ts.py
md5: 5c6636faa9a2e305a287c80c93fd21e2
Expand Down Expand Up @@ -338,8 +338,8 @@ stages:
md5: 815d3962113254bf95f9202da269133f
size: 1719
- path: src/utils/converters.py
md5: 44acb57fe41c377603ab47a8307ab17d
size: 1974
md5: 639d546c28cbbff4ad61eaa8a1836388
size: 2040
outs:
- path: data/parsed/jeas118_loads.csv
md5: c6217df93e56a59da4e31a1096f46908
Expand Down Expand Up @@ -410,8 +410,8 @@ stages:
md5: bb89979568178202ec0a8b3e9804ade1
size: 1907
- path: src/utils/converters.py
md5: 44acb57fe41c377603ab47a8307ab17d
size: 1974
md5: 639d546c28cbbff4ad61eaa8a1836388
size: 2040
outs:
- path: data/parsed/jeas118_lines.csv
md5: b8b4a9d8ea68a6f2ad28b7f1f66fc96e
Expand All @@ -427,8 +427,8 @@ stages:
md5: 6250d678317728e20779e43a1d9d274a
size: 1738
- path: src/utils/converters.py
md5: 44acb57fe41c377603ab47a8307ab17d
size: 1974
md5: 639d546c28cbbff4ad61eaa8a1836388
size: 2040
outs:
- path: data/parsed/jeas118_buses.csv
md5: 4777d14a3355b508d6d97485b5d76e54
Expand All @@ -449,8 +449,8 @@ stages:
md5: 434edcb03d694eecdadaa14069b75cbb
size: 2265
- path: src/data/check/buses.py
md5: cd78ab87578bb8667cd4ad714ca4f945
size: 1492
md5: ff4ba8860b611f636f5a33264e29d7e2
size: 1550
- path: src/data/prepare/buses.py
md5: f12bdfc15b66c42be3b6c03c44607b2a
size: 2990
Expand Down Expand Up @@ -527,8 +527,8 @@ stages:
md5: 57a4ae7c81f6f8278d057358227b3915
size: 16682
- path: src/data/check/gens.py
md5: e8f5b9c0206ebb329c8123f76d415324
size: 1609
md5: a685d1ae67b1983c50efa17156f6d27a
size: 1667
- path: src/data/prepare/gens.py
md5: cea0dde3d45499c31c60a2a20a32efae
size: 1510
Expand All @@ -547,8 +547,8 @@ stages:
md5: b21ea2867869374e80deaba4fad47941
size: 134375
- path: src/data/transform/outages_ts.py
md5: 293104d923d4cf8f2e9cff53cec1c57c
size: 4820
md5: ed6eb5d98dc4347acd1ebe17ca67ce06
size: 4821
- path: src/utils/data_loaders/load_df_data.py
md5: f3b1048c9e46162b1c47094fc7cecab9
size: 953
Expand Down Expand Up @@ -588,8 +588,8 @@ stages:
md5: 8a27078afa53fd55f672518459e3bcf8
size: 1951
- path: src/utils/converters.py
md5: 44acb57fe41c377603ab47a8307ab17d
size: 1974
md5: 639d546c28cbbff4ad61eaa8a1836388
size: 2040
outs:
- path: data/parsed/jeas118_trafos.csv
md5: d73032f443fdd27df9c3ed909590e7bd
Expand All @@ -613,8 +613,8 @@ stages:
md5: 806381a3d75530bca1df0527060ca994
size: 5860
- path: src/data/check/branches.py
md5: 5cdb10170e87c43f821a8bc784866ac7
size: 2410
md5: a893e80ab48880c69b23f2e3e3ffd1b7
size: 2468
- path: src/data/prepare/branches.py
md5: b00c60cbc426d9c03ec36f9fae216faa
size: 4542
Expand All @@ -640,8 +640,8 @@ stages:
md5: 5b288dc3b5402cf00a237d689e4e31d2
size: 4770
- path: src/data/check/loads.py
md5: 938a0150d51595e5d155ffa90bdb82be
size: 1425
md5: 33a686e8bad54aed1cced283ad0079f9
size: 1483
- path: src/data/prepare/loads.py
md5: 0bc84b1094e81578e977209b6a523a33
size: 1330
Expand All @@ -668,8 +668,8 @@ stages:
md5: 5b288dc3b5402cf00a237d689e4e31d2
size: 4770
- path: src/data/check/loads_ts.py
md5: 539edf911a77008b11d814772cf94604
size: 2234
md5: d7ccfe7c813aafc3aa94398a769d6a48
size: 2292
- path: src/data/prepare/loads_ts.py
md5: 8869f8c33e937591b31567f2c78a80bb
size: 3380
Expand All @@ -695,7 +695,7 @@ stages:
deps:
- path: data/raw/nrel118/Input files/RT/Wind
md5: a46f8ccf7c19116d82cba65df615e2de.dir
size: 4663311
size: 4812656
nfiles: 18
- path: src/data/parse/nrel118_winds_ts.py
md5: 677933934d7ea5f451c2e70ada5ce81d
Expand Down Expand Up @@ -730,7 +730,7 @@ stages:
deps:
- path: data/raw/nrel118/Input files/RT/Solar
md5: e8e3065fef2b05440af5bef1c00157c0.dir
size: 16761318
size: 17420193
nfiles: 76
- path: src/data/parse/nrel118_solars_ts.py
md5: a594b44eebc40dc5e6771333b1fab876
Expand Down Expand Up @@ -941,8 +941,8 @@ stages:
md5: 708649d096d6d2322729213b24cbd51f
size: 134756
- path: src/data/check/gens_ts.py
md5: 1b90fe28356f785b3ea2709a2b34b7ed
size: 4196
md5: e8e4394d993c12d75a3c08d751225193
size: 4254
- path: src/data/prepare/gens_ts.py
md5: df34304a66b806b6babc494580b0b612
size: 4543
Expand Down Expand Up @@ -986,14 +986,14 @@ stages:
md5: 0e01674376a335fd11de0ebab060b372
size: 45800804
- path: src/power_flow/builders/base.py
md5: 58258b90adab8036fd185d0770a4b7b4
size: 10025
md5: deca227b59530124d87f06e168992de2
size: 10240
- path: src/power_flow/builders/pandapower.py
md5: 94d13942e89f28da588202e7abe2cfd9
size: 12591
md5: 42960f180229a2b4fca988d032aad59c
size: 12761
- path: src/power_flow/building.py
md5: 088ff19876bce034f2852763e9ce7989
size: 2057
md5: a8d62d659a378e1537a08b18216b5f7c
size: 2138
- path: src/utils/data_loaders/load_df_data.py
md5: f3b1048c9e46162b1c47094fc7cecab9
size: 953
Expand Down
15 changes: 8 additions & 7 deletions notebooks/prepare_power_flow_data.ipynb

Large diffs are not rendered by default.

48 changes: 47 additions & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 31754dd

Please sign in to comment.