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

Initial setup of pp2psdm converter #12

Open
wants to merge 34 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
6bec701
tests
danielfeismann Sep 11, 2024
d3e92dc
converting nodes
danielfeismann Sep 11, 2024
b331e8e
converting line types
danielfeismann Sep 11, 2024
b233ec8
converting lines
danielfeismann Sep 11, 2024
920fc45
fmt
danielfeismann Sep 11, 2024
dac7b91
add transformer conversion
danielfeismann Sep 12, 2024
d278f2b
adapt convert grid
danielfeismann Sep 12, 2024
5f063ed
fix method inputs
danielfeismann Sep 12, 2024
30f5818
flake
danielfeismann Sep 12, 2024
6f5d8da
fmt
danielfeismann Sep 12, 2024
1c401ef
update ci
danielfeismann Sep 12, 2024
382c222
poetry
danielfeismann Sep 12, 2024
8544829
poetry
danielfeismann Sep 12, 2024
4345c06
poetry
danielfeismann Sep 12, 2024
505ebd2
asyncpg
danielfeismann Sep 12, 2024
d1f735d
asyncpg poetry
danielfeismann Sep 12, 2024
cfdb204
pg8000 = ">=1.29.0"
danielfeismann Sep 12, 2024
6aa9769
poetry
danielfeismann Sep 12, 2024
b1c7683
poetry
danielfeismann Sep 12, 2024
e8f62d2
poetry
danielfeismann Sep 12, 2024
aff0933
update ci
danielfeismann Sep 12, 2024
b349654
update ci
danielfeismann Sep 12, 2024
c564d2b
include type parameter into lines and transformer
danielfeismann Sep 12, 2024
1345c3a
fmt
danielfeismann Sep 12, 2024
a0f1a3a
fix test_convert_grid
danielfeismann Sep 12, 2024
7a81cc4
fix test_convert_grid
danielfeismann Sep 12, 2024
2a55fed
readme and clean up
danielfeismann Sep 12, 2024
8016dc0
Merge branch 'refs/heads/main' into df/#11-init
danielfeismann Sep 12, 2024
a163d36
poetry
danielfeismann Sep 12, 2024
61d3dd0
delete empty files
danielfeismann Sep 12, 2024
c2ddee3
__init__.py
danielfeismann Sep 12, 2024
d6bd6fc
adapt return type
danielfeismann Dec 3, 2024
abff61b
remove redundant value
danielfeismann Dec 3, 2024
e789fc3
Merge branch 'main' into df/#11-init
danielfeismann Dec 3, 2024
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
57 changes: 13 additions & 44 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,53 +1,22 @@
# python-template
# pp2psdm

Python template that includes all the basics for your new shiny project.

## Setup
This is a work-in-progress tool for converting [pandapower](https://github.com/e2nIEE/pandapower) to [PSDM](https://github.com/ie3-institute/PowerSystemDataModel) grid models.

1. Open a new repository while using this template.
This repository is marked as a template repository.
Github offers you the convenient possibility to open a new repository from a such a template repository.
See [here](https://docs.github.com/en/repositories/creating-and-managing-repositories/creating-a-repository-from-a-template) for details.
2. Clone your new repository
3. Rename the `python-project` package to your project name (this is where your source code should go).
4. Install the dependencies (preferably within a fresh virtual environment)
5. Run `pre-commit install`
6. Enjoy!

## What's in here?
## Limitations

### Formatting
- Currently only basic grid model conversion supported
- No switch conversion implemented yet

To spare you the pain of manually taking care of formatting your code and establish some consistency (remember "äußere Ordnung führt zu innerer Ordnung") it includes [Black](https://black.readthedocs.io/en/stable/) for automated formatting.
Execute `black .` in the terminal at the project's root directory to format your code.

### Testing
## Usage

To make sure your code actually does what you think it does!
The template includes [pytest](https://docs.pytest.org/en/7.1.x/) for that purpose.
Include the tests in the `tests` directory. Running `pytest` in the terminal at the project's root directory executes all tests and hopefully replaces hoping that your code works by knowing (at least so far as your actual test all relevant cases and boundary conditions).
```py
from pypsdm import RawGridContainer
from pp2psdm.grid import convert_grid

### CI

To give you a slap on the wrist if you did not apply the formatter or your tests don't pass there is a [Github Actions](https://github.com/features/actions) workflow at `.github/workflows/simple-ci.yml`.
After pushing to the remote repository it checks out your code, installs all the dependencies then runs `flake8` for any code style issues and `black --check` to check the formatting.
Depending on how that went you will see yourself either confronted with a friendly green tick or rather unfriendly red cross at the code window in github (or the `Actions` section of the github repository.)

### Pre-Commit

To reduce slaps on the wrist there is [pre-commit](https://pre-commit.com/) having your back.
It installs pre-commit hooks that `black` and `flake8` before the CI gets a chance to complain.
The types of git hooks are configured in `.pre-commit-config.yaml`.
To install the hooks run `pre-commit install` once in the terminal at the project's root directory.

### Dependabot

To keep the dust off your dependencies [Dependabot](https://github.blog/2020-06-01-keep-all-your-packages-up-to-date-with-dependabot/) checks for new versions once a day (according to current cofigurations) and opens Pull-Requests in case it finds any newer versions.
The configuration can be changed at `.github/dependabot.yml`
Keep in mind that dependency updates can break your code.
You safeguard yourself against this by making sure you have all your code tested and the dependency pull request does not break any of them.

## Something Missing?

We are happy to learn about additional tools for easing the developer workflow.
Feel free to open an issue or pull-request to make suggestions.
pp_path = "/my/psdm_grid/path"
psdm_grid = RawGridContainer.from_csv(psdm_path)
pp_grid, uuid_idx_maps = convert_grid(psdm_grid)
```
2 changes: 0 additions & 2 deletions poetry.lock

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

Empty file removed pp2psdm/conversion/__init__.py
Empty file.
109 changes: 0 additions & 109 deletions pp2psdm/conversion/pandapower.py

This file was deleted.

Loading
Loading