Skip to content

Commit

Permalink
Merge branch 'main' into feature/csv-dir-store
Browse files Browse the repository at this point in the history
Signed-off-by: Bram Stoeller <[email protected]>
  • Loading branch information
bramstoeller committed Nov 29, 2022
2 parents 65e62c4 + 70915e8 commit bb50082
Show file tree
Hide file tree
Showing 63 changed files with 3,285 additions and 877 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/build-test-and-sonar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,19 @@ jobs:
pip install power-grid-model-io[dev]==${{ steps.version.outputs.version }} --find-links=wheelhouse
pytest
- name: Validation tests
run: pytest tests/validation --no-cov --verbose

- name: Test and Coverage for sonar cloud in develop mode
run: |
pip uninstall -y power-grid-model-io
pip install -e .[dev]
pytest --cov-report=xml:coverage.xml
cat coverage.xml
# Fix relative paths in coverage file
# Known bug: https://community.sonarsource.com/t/sonar-on-github-actions-with-python-coverage-source-issue/36057
sed -i 's@/home/runner/work/power-grid-model-io/power-grid-model-io@/github/workspace@g' coverage.xml
cat coverage.xml
- name: SonarCloud Scan
# only run sonar server in push event or pull request event from own repo
if: ${{ (github.event_name == 'push') || (github.event.pull_request.head.repo.owner.login == 'alliander-opensource') }}
Expand Down
11 changes: 9 additions & 2 deletions .github/workflows/check-blocking-labels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@
name: Check Blocking Labels

on:
workflow_dispatch:
pull_request:
branches:
- main
types:
- opened
- synchronize
- labeled
- unlabeled

Expand All @@ -25,8 +26,14 @@ jobs:
echo "This pull request should not be merged (do-not-merge)"
exit 1
- name: merge-target-first
if: contains(github.event.pull_request.labels.*.name, 'merge-target-first')
run: |
echo "The target branch of this PR should be merged first (merge-target-first)"
exit 2
- name: needs-unit-tests
if: contains(github.event.pull_request.labels.*.name, 'needs-unit-tests')
run: |
echo "This pull request needs (more) unit tests before it may be merged (needs-unit-tests)"
exit 2
exit 3
2 changes: 1 addition & 1 deletion .github/workflows/check-code-quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
- name: Install and run mypy
run: |
pip install mypy
mypy .
mypy src
- name: Install and run pylint
run: |
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@ wheelhouse/

# temporary_files
__pycache__/
.coverage
.ipynb_checkpoints/
.mypy_cache/
.pytest_cache/
.coverage
cov_html/

# Virtual environment
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ repos:
hooks:
- id: black
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.982
rev: v0.991
hooks:
- id: mypy
- repo: local
Expand Down
37 changes: 4 additions & 33 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,42 +23,13 @@ SPDX-License-Identifier: MPL-2.0
# Power Grid Model Input/Output

`power-grid-model-io` can be used for various conversions to the [power-grid-model](https://github.com/alliander-opensource/power-grid-model).
For detailed documentation, see [Read the Docs](https://power-grid-model-io.readthedocs.io/en/stable/index.html).

## Documentation:
* Converters
* [Tabular Converter](docs/converters/tabular_converter.md)
# Examples
* [PGM JSON Example](docs/examples/pgm_json_example.ipynb)
* [Vision/Gaia Example](docs/examples/vision_gaia_example.ipynb)


## Client tools

Installation:
```bash
pip install -e .[cli]
```

Usage:
```bash
pgm_validate DATA_FORMAT [ARGS]
pgm_convert CONVERSION [ARGS]
```

### Native Power Grid Model JSON format

```bash
pgm_validate pgm_json input_data.json
```

### Vision Excel format

```bash
pgm_convert vision2pgm myfile.xlsx --validate
```

### Gaia Excel format

```bash
pgm_convert gaia2pgm myfile.xlsx types.xlsx --validate
```
# License
This project is licensed under the Mozilla Public License, version 2.0 - see [LICENSE](LICENSE) for details.

Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.1
1.0
6 changes: 3 additions & 3 deletions docs/examples/data/tiny-net/input.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"node":
[
{"id": 1, "u_rated": 10500.0, "extra": {"name": "First Node"}},
{"id": 2, "u_rated": 10500.0, "extra": {"name": "Second Node"}},
{"id": 3, "u_rated": 10500.0, "extra": {"name": "Third Node"}}
{"id": 1, "u_rated": 10500.0, "name": "First Node"},
{"id": 2, "u_rated": 10500.0, "name": "Second Node"},
{"id": 3, "u_rated": 10500.0, "name": "Third Node"}
],
"line":
[
Expand Down
6 changes: 3 additions & 3 deletions docs/examples/data/tiny-net/sym_output.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
],
"node":
[
{"id": 1, "energized": 1, "u_pu": 1.0239116757788667, "u": 10751.0725956781, "u_angle": -0.013054638926272096, "extra": {"name": "First Node"}},
{"id": 2, "energized": 1, "u_pu": 1.0240665324860059, "u": 10752.698591103062, "u_angle": -0.017637349459711085, "extra": {"name": "Second Node"}},
{"id": 3, "energized": 1, "u_pu": 1.0236495952266011, "u": 10748.320749879313, "u_angle": -0.020182330759471272, "extra": {"name": "Third Node"}}
{"id": 1, "energized": 1, "u_pu": 1.0239116757788667, "u": 10751.0725956781, "u_angle": -0.013054638926272096, "name": "First Node"},
{"id": 2, "energized": 1, "u_pu": 1.0240665324860059, "u": 10752.698591103062, "u_angle": -0.017637349459711085, "name": "Second Node"},
{"id": 3, "energized": 1, "u_pu": 1.0236495952266011, "u": 10748.320749879313, "u_angle": -0.020182330759471272, "name": "Third Node"}
],
"source":
[
Expand Down
Binary file modified docs/examples/data/vision/example.xlsx
Binary file not shown.
Loading

0 comments on commit bb50082

Please sign in to comment.