simbench 1.4.0__zip → 1.5.1__zip
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- simbench-1.5.1/.github/workflows/github_test_action.yml +130 -0
- simbench-1.5.1/.github/workflows/test_release.yml +58 -0
- simbench-1.5.1/.github/workflows/upload_release.yml +51 -0
- {simbench-1.4.0 → simbench-1.5.1}/CHANGELOG.rst +11 -1
- {simbench-1.4.0 → simbench-1.5.1}/PKG-INFO +54 -9
- {simbench-1.4.0 → simbench-1.5.1}/README.rst +0 -2
- simbench-1.5.1/pyproject.toml +75 -0
- {simbench-1.4.0 → simbench-1.5.1}/setup.cfg +0 -3
- simbench-1.5.1/setup.py +3 -0
- {simbench-1.4.0 → simbench-1.5.1}/simbench/converter/auxiliary.py +27 -10
- {simbench-1.4.0 → simbench-1.5.1}/simbench/converter/csv_data_manipulation.py +7 -7
- {simbench-1.4.0 → simbench-1.5.1}/simbench/converter/csv_pp_converter.py +49 -37
- {simbench-1.4.0 → simbench-1.5.1}/simbench/converter/format_information.py +1 -1
- {simbench-1.4.0 → simbench-1.5.1}/simbench/converter/pp_net_manipulation.py +64 -52
- {simbench-1.4.0 → simbench-1.5.1}/simbench/converter/read_and_write.py +4 -4
- {simbench-1.4.0 → simbench-1.5.1}/simbench/converter/voltLvl.py +1 -1
- {simbench-1.4.0 → simbench-1.5.1}/simbench/networks/extract_simbench_grids_from_csv.py +30 -23
- {simbench-1.4.0 → simbench-1.5.1}/simbench/networks/profiles.py +23 -29
- {simbench-1.4.0 → simbench-1.5.1}/simbench/networks/simbench_code.py +12 -11
- {simbench-1.4.0 → simbench-1.5.1/simbench}/simbench.egg-info/PKG-INFO +54 -9
- {simbench-1.4.0 → simbench-1.5.1/simbench}/simbench.egg-info/SOURCES.txt +8 -8
- simbench-1.5.1/simbench/simbench.egg-info/requires.txt +43 -0
- simbench-1.5.1/simbench/simbench.egg-info/top_level.txt +3 -0
- {simbench-1.4.0 → simbench-1.5.1}/simbench/test/converter/test_auxiliary.py +12 -10
- {simbench-1.4.0 → simbench-1.5.1}/simbench/test/converter/test_csv_pp_converter.py +9 -5
- {simbench-1.4.0 → simbench-1.5.1}/simbench/test/converter/test_pp_net_manipulation.py +5 -1
- {simbench-1.4.0 → simbench-1.5.1}/simbench/test/converter/test_voltLvl.py +3 -3
- {simbench-1.4.0 → simbench-1.5.1}/simbench/test/networks/test_extract_grids_from_csv.py +3 -3
- {simbench-1.4.0 → simbench-1.5.1}/simbench/test/networks/test_profiles.py +4 -4
- {simbench-1.4.0 → simbench-1.5.1}/simbench/test/networks/test_simbench_code.py +2 -2
- {simbench-1.4.0 → simbench-1.5.1}/simbench/test/networks/test_simbench_loadcases.py +1 -1
- simbench-1.4.0/.github/workflows/github_test_action.yml +0 -53
- simbench-1.4.0/.github/workflows/release.yml +0 -112
- simbench-1.4.0/setup.py +0 -55
- simbench-1.4.0/simbench/__init__.py +0 -12
- simbench-1.4.0/simbench.egg-info/requires.txt +0 -18
- simbench-1.4.0/simbench.egg-info/top_level.txt +0 -1
- {simbench-1.4.0 → simbench-1.5.1}/AUTHORS +0 -0
- {simbench-1.4.0 → simbench-1.5.1}/LICENSE +0 -0
- {simbench-1.4.0 → simbench-1.5.1}/MANIFEST.in +0 -0
- {simbench-1.4.0 → simbench-1.5.1}/requirements.txt +0 -0
- {simbench-1.4.0 → simbench-1.5.1}/simbench/converter/__init__.py +0 -0
- {simbench-1.4.0 → simbench-1.5.1}/simbench/networks/1-complete_data-mixed-all-0-sw/Coordinates.csv +0 -0
- {simbench-1.4.0 → simbench-1.5.1}/simbench/networks/1-complete_data-mixed-all-0-sw/ExternalNet.csv +0 -0
- {simbench-1.4.0 → simbench-1.5.1}/simbench/networks/1-complete_data-mixed-all-0-sw/Line.csv +0 -0
- {simbench-1.4.0 → simbench-1.5.1}/simbench/networks/1-complete_data-mixed-all-0-sw/LineType.csv +0 -0
- {simbench-1.4.0 → simbench-1.5.1}/simbench/networks/1-complete_data-mixed-all-0-sw/Load.csv +0 -0
- {simbench-1.4.0 → simbench-1.5.1}/simbench/networks/1-complete_data-mixed-all-0-sw/LoadProfile.csv +0 -0
- {simbench-1.4.0 → simbench-1.5.1}/simbench/networks/1-complete_data-mixed-all-0-sw/Measurement.csv +0 -0
- {simbench-1.4.0 → simbench-1.5.1}/simbench/networks/1-complete_data-mixed-all-0-sw/Node.csv +0 -0
- {simbench-1.4.0 → simbench-1.5.1}/simbench/networks/1-complete_data-mixed-all-0-sw/PowerPlant.csv +0 -0
- {simbench-1.4.0 → simbench-1.5.1}/simbench/networks/1-complete_data-mixed-all-0-sw/PowerPlantProfile.csv +0 -0
- {simbench-1.4.0 → simbench-1.5.1}/simbench/networks/1-complete_data-mixed-all-0-sw/RES.csv +0 -0
- {simbench-1.4.0 → simbench-1.5.1}/simbench/networks/1-complete_data-mixed-all-0-sw/RESProfile.csv +0 -0
- {simbench-1.4.0 → simbench-1.5.1}/simbench/networks/1-complete_data-mixed-all-0-sw/StudyCases.csv +0 -0
- {simbench-1.4.0 → simbench-1.5.1}/simbench/networks/1-complete_data-mixed-all-0-sw/Substation.csv +0 -0
- {simbench-1.4.0 → simbench-1.5.1}/simbench/networks/1-complete_data-mixed-all-0-sw/Switch.csv +0 -0
- {simbench-1.4.0 → simbench-1.5.1}/simbench/networks/1-complete_data-mixed-all-0-sw/Transformer.csv +0 -0
- {simbench-1.4.0 → simbench-1.5.1}/simbench/networks/1-complete_data-mixed-all-0-sw/TransformerType.csv +0 -0
- {simbench-1.4.0 → simbench-1.5.1}/simbench/networks/1-complete_data-mixed-all-1-sw/Coordinates.csv +0 -0
- {simbench-1.4.0 → simbench-1.5.1}/simbench/networks/1-complete_data-mixed-all-1-sw/DCLineType.csv +0 -0
- {simbench-1.4.0 → simbench-1.5.1}/simbench/networks/1-complete_data-mixed-all-1-sw/ExternalNet.csv +0 -0
- {simbench-1.4.0 → simbench-1.5.1}/simbench/networks/1-complete_data-mixed-all-1-sw/Line.csv +0 -0
- {simbench-1.4.0 → simbench-1.5.1}/simbench/networks/1-complete_data-mixed-all-1-sw/LineType.csv +0 -0
- {simbench-1.4.0 → simbench-1.5.1}/simbench/networks/1-complete_data-mixed-all-1-sw/Load.csv +0 -0
- {simbench-1.4.0 → simbench-1.5.1}/simbench/networks/1-complete_data-mixed-all-1-sw/LoadProfile.csv +0 -0
- {simbench-1.4.0 → simbench-1.5.1}/simbench/networks/1-complete_data-mixed-all-1-sw/Measurement.csv +0 -0
- {simbench-1.4.0 → simbench-1.5.1}/simbench/networks/1-complete_data-mixed-all-1-sw/Node.csv +0 -0
- {simbench-1.4.0 → simbench-1.5.1}/simbench/networks/1-complete_data-mixed-all-1-sw/PowerPlant.csv +0 -0
- {simbench-1.4.0 → simbench-1.5.1}/simbench/networks/1-complete_data-mixed-all-1-sw/PowerPlantProfile.csv +0 -0
- {simbench-1.4.0 → simbench-1.5.1}/simbench/networks/1-complete_data-mixed-all-1-sw/RES.csv +0 -0
- {simbench-1.4.0 → simbench-1.5.1}/simbench/networks/1-complete_data-mixed-all-1-sw/RESProfile.csv +0 -0
- {simbench-1.4.0 → simbench-1.5.1}/simbench/networks/1-complete_data-mixed-all-1-sw/Storage.csv +0 -0
- {simbench-1.4.0 → simbench-1.5.1}/simbench/networks/1-complete_data-mixed-all-1-sw/StorageProfile.csv +0 -0
- {simbench-1.4.0 → simbench-1.5.1}/simbench/networks/1-complete_data-mixed-all-1-sw/StudyCases.csv +0 -0
- {simbench-1.4.0 → simbench-1.5.1}/simbench/networks/1-complete_data-mixed-all-1-sw/Substation.csv +0 -0
- {simbench-1.4.0 → simbench-1.5.1}/simbench/networks/1-complete_data-mixed-all-1-sw/Switch.csv +0 -0
- {simbench-1.4.0 → simbench-1.5.1}/simbench/networks/1-complete_data-mixed-all-1-sw/Transformer.csv +0 -0
- {simbench-1.4.0 → simbench-1.5.1}/simbench/networks/1-complete_data-mixed-all-1-sw/TransformerType.csv +0 -0
- {simbench-1.4.0 → simbench-1.5.1}/simbench/networks/1-complete_data-mixed-all-2-sw/Coordinates.csv +0 -0
- {simbench-1.4.0 → simbench-1.5.1}/simbench/networks/1-complete_data-mixed-all-2-sw/DCLineType.csv +0 -0
- {simbench-1.4.0 → simbench-1.5.1}/simbench/networks/1-complete_data-mixed-all-2-sw/ExternalNet.csv +0 -0
- {simbench-1.4.0 → simbench-1.5.1}/simbench/networks/1-complete_data-mixed-all-2-sw/Line.csv +0 -0
- {simbench-1.4.0 → simbench-1.5.1}/simbench/networks/1-complete_data-mixed-all-2-sw/LineType.csv +0 -0
- {simbench-1.4.0 → simbench-1.5.1}/simbench/networks/1-complete_data-mixed-all-2-sw/Load.csv +0 -0
- {simbench-1.4.0 → simbench-1.5.1}/simbench/networks/1-complete_data-mixed-all-2-sw/LoadProfile.csv +0 -0
- {simbench-1.4.0 → simbench-1.5.1}/simbench/networks/1-complete_data-mixed-all-2-sw/Measurement.csv +0 -0
- {simbench-1.4.0 → simbench-1.5.1}/simbench/networks/1-complete_data-mixed-all-2-sw/Node.csv +0 -0
- {simbench-1.4.0 → simbench-1.5.1}/simbench/networks/1-complete_data-mixed-all-2-sw/PowerPlant.csv +0 -0
- {simbench-1.4.0 → simbench-1.5.1}/simbench/networks/1-complete_data-mixed-all-2-sw/PowerPlantProfile.csv +0 -0
- {simbench-1.4.0 → simbench-1.5.1}/simbench/networks/1-complete_data-mixed-all-2-sw/RES.csv +0 -0
- {simbench-1.4.0 → simbench-1.5.1}/simbench/networks/1-complete_data-mixed-all-2-sw/RESProfile.csv +0 -0
- {simbench-1.4.0 → simbench-1.5.1}/simbench/networks/1-complete_data-mixed-all-2-sw/Storage.csv +0 -0
- {simbench-1.4.0 → simbench-1.5.1}/simbench/networks/1-complete_data-mixed-all-2-sw/StorageProfile.csv +0 -0
- {simbench-1.4.0 → simbench-1.5.1}/simbench/networks/1-complete_data-mixed-all-2-sw/StudyCases.csv +0 -0
- {simbench-1.4.0 → simbench-1.5.1}/simbench/networks/1-complete_data-mixed-all-2-sw/Substation.csv +0 -0
- {simbench-1.4.0 → simbench-1.5.1}/simbench/networks/1-complete_data-mixed-all-2-sw/Switch.csv +0 -0
- {simbench-1.4.0 → simbench-1.5.1}/simbench/networks/1-complete_data-mixed-all-2-sw/Transformer.csv +0 -0
- {simbench-1.4.0 → simbench-1.5.1}/simbench/networks/1-complete_data-mixed-all-2-sw/TransformerType.csv +0 -0
- {simbench-1.4.0 → simbench-1.5.1}/simbench/networks/__init__.py +0 -0
- {simbench-1.4.0 → simbench-1.5.1}/simbench/networks/loadcases.py +0 -0
- {simbench-1.4.0 → simbench-1.5.1/simbench}/simbench.egg-info/dependency_links.txt +0 -0
- {simbench-1.4.0 → simbench-1.5.1}/simbench/test/__init__.py +0 -0
- {simbench-1.4.0 → simbench-1.5.1}/simbench/test/converter/__init__.py +0 -0
- {simbench-1.4.0 → simbench-1.5.1}/simbench/test/converter/test_network/Coordinates.csv +0 -0
- {simbench-1.4.0 → simbench-1.5.1}/simbench/test/converter/test_network/DCLineType.csv +0 -0
- {simbench-1.4.0 → simbench-1.5.1}/simbench/test/converter/test_network/ExternalNet.csv +0 -0
- {simbench-1.4.0 → simbench-1.5.1}/simbench/test/converter/test_network/Line.csv +0 -0
- {simbench-1.4.0 → simbench-1.5.1}/simbench/test/converter/test_network/LineType.csv +0 -0
- {simbench-1.4.0 → simbench-1.5.1}/simbench/test/converter/test_network/Load.csv +0 -0
- {simbench-1.4.0 → simbench-1.5.1}/simbench/test/converter/test_network/LoadProfile.csv +0 -0
- {simbench-1.4.0 → simbench-1.5.1}/simbench/test/converter/test_network/Measurement.csv +0 -0
- {simbench-1.4.0 → simbench-1.5.1}/simbench/test/converter/test_network/Node.csv +0 -0
- {simbench-1.4.0 → simbench-1.5.1}/simbench/test/converter/test_network/PowerPlant.csv +0 -0
- {simbench-1.4.0 → simbench-1.5.1}/simbench/test/converter/test_network/PowerPlantProfile.csv +0 -0
- {simbench-1.4.0 → simbench-1.5.1}/simbench/test/converter/test_network/RES.csv +0 -0
- {simbench-1.4.0 → simbench-1.5.1}/simbench/test/converter/test_network/RESProfile.csv +0 -0
- {simbench-1.4.0 → simbench-1.5.1}/simbench/test/converter/test_network/Shunt.csv +0 -0
- {simbench-1.4.0 → simbench-1.5.1}/simbench/test/converter/test_network/Storage.csv +0 -0
- {simbench-1.4.0 → simbench-1.5.1}/simbench/test/converter/test_network/StorageProfile.csv +0 -0
- {simbench-1.4.0 → simbench-1.5.1}/simbench/test/converter/test_network/StudyCases.csv +0 -0
- {simbench-1.4.0 → simbench-1.5.1}/simbench/test/converter/test_network/Substation.csv +0 -0
- {simbench-1.4.0 → simbench-1.5.1}/simbench/test/converter/test_network/Switch.csv +0 -0
- {simbench-1.4.0 → simbench-1.5.1}/simbench/test/converter/test_network/Transformer.csv +0 -0
- {simbench-1.4.0 → simbench-1.5.1}/simbench/test/converter/test_network/TransformerType.csv +0 -0
- {simbench-1.4.0 → simbench-1.5.1}/simbench/test/converter/test_network_output_folder/Coordinates.csv +0 -0
- {simbench-1.4.0 → simbench-1.5.1}/simbench/test/converter/test_network_output_folder/DCLineType.csv +0 -0
- {simbench-1.4.0 → simbench-1.5.1}/simbench/test/converter/test_network_output_folder/ExternalNet.csv +0 -0
- {simbench-1.4.0 → simbench-1.5.1}/simbench/test/converter/test_network_output_folder/Line.csv +0 -0
- {simbench-1.4.0 → simbench-1.5.1}/simbench/test/converter/test_network_output_folder/LineType.csv +0 -0
- {simbench-1.4.0 → simbench-1.5.1}/simbench/test/converter/test_network_output_folder/Load.csv +0 -0
- {simbench-1.4.0 → simbench-1.5.1}/simbench/test/converter/test_network_output_folder/LoadProfile.csv +0 -0
- {simbench-1.4.0 → simbench-1.5.1}/simbench/test/converter/test_network_output_folder/Measurement.csv +0 -0
- {simbench-1.4.0 → simbench-1.5.1}/simbench/test/converter/test_network_output_folder/Node.csv +0 -0
- {simbench-1.4.0 → simbench-1.5.1}/simbench/test/converter/test_network_output_folder/PowerPlant.csv +0 -0
- {simbench-1.4.0 → simbench-1.5.1}/simbench/test/converter/test_network_output_folder/PowerPlantProfile.csv +0 -0
- {simbench-1.4.0 → simbench-1.5.1}/simbench/test/converter/test_network_output_folder/RES.csv +0 -0
- {simbench-1.4.0 → simbench-1.5.1}/simbench/test/converter/test_network_output_folder/RESProfile.csv +0 -0
- {simbench-1.4.0 → simbench-1.5.1}/simbench/test/converter/test_network_output_folder/Shunt.csv +0 -0
- {simbench-1.4.0 → simbench-1.5.1}/simbench/test/converter/test_network_output_folder/Storage.csv +0 -0
- {simbench-1.4.0 → simbench-1.5.1}/simbench/test/converter/test_network_output_folder/StorageProfile.csv +0 -0
- {simbench-1.4.0 → simbench-1.5.1}/simbench/test/converter/test_network_output_folder/StudyCases.csv +0 -0
- {simbench-1.4.0 → simbench-1.5.1}/simbench/test/converter/test_network_output_folder/Substation.csv +0 -0
- {simbench-1.4.0 → simbench-1.5.1}/simbench/test/converter/test_network_output_folder/Switch.csv +0 -0
- {simbench-1.4.0 → simbench-1.5.1}/simbench/test/converter/test_network_output_folder/Transformer.csv +0 -0
- {simbench-1.4.0 → simbench-1.5.1}/simbench/test/converter/test_network_output_folder/TransformerType.csv +0 -0
- {simbench-1.4.0 → simbench-1.5.1}/simbench/test/networks/__init__.py +0 -0
- {simbench-1.4.0 → simbench-1.5.1}/simbench/test/run_tests.py +0 -0
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
|
|
2
|
+
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
|
|
3
|
+
|
|
4
|
+
name: simbench
|
|
5
|
+
|
|
6
|
+
on:
|
|
7
|
+
push:
|
|
8
|
+
branches: '*'
|
|
9
|
+
paths-ignore:
|
|
10
|
+
- 'CHANGELOG.rst'
|
|
11
|
+
pull_request:
|
|
12
|
+
branches: '*'
|
|
13
|
+
paths-ignore:
|
|
14
|
+
- 'CHANGELOG.rst'
|
|
15
|
+
|
|
16
|
+
jobs:
|
|
17
|
+
|
|
18
|
+
build:
|
|
19
|
+
runs-on: ubuntu-latest
|
|
20
|
+
strategy:
|
|
21
|
+
matrix:
|
|
22
|
+
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
|
|
23
|
+
steps:
|
|
24
|
+
- uses: actions/checkout@v4
|
|
25
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
26
|
+
uses: actions/setup-python@v5
|
|
27
|
+
with:
|
|
28
|
+
python-version: ${{ matrix.python-version }}
|
|
29
|
+
- name: Install dependencies
|
|
30
|
+
run: |
|
|
31
|
+
python -m pip install --upgrade pip
|
|
32
|
+
python -m pip install pytest jupyter
|
|
33
|
+
python -m pip install $GITHUB_WORKSPACE["test"]
|
|
34
|
+
- name: List of installed packages
|
|
35
|
+
run: |
|
|
36
|
+
python -m pip list
|
|
37
|
+
- name: Test with pytest
|
|
38
|
+
if: ${{ matrix.python-version != '3.9' }}
|
|
39
|
+
run: |
|
|
40
|
+
pytest
|
|
41
|
+
- name: Test with pytest and Codecov
|
|
42
|
+
if: ${{ matrix.python-version == '3.9' }}
|
|
43
|
+
run: |
|
|
44
|
+
pip install pytest-cov
|
|
45
|
+
pytest --cov=./ --cov-report=xml
|
|
46
|
+
- name: Upload coverage to Codecov
|
|
47
|
+
if: ${{ matrix.python-version == '3.9' }}
|
|
48
|
+
uses: codecov/codecov-action@v1
|
|
49
|
+
with:
|
|
50
|
+
verbose: true
|
|
51
|
+
|
|
52
|
+
warnings:
|
|
53
|
+
|
|
54
|
+
runs-on: ubuntu-latest
|
|
55
|
+
timeout-minutes: 30
|
|
56
|
+
steps:
|
|
57
|
+
- uses: actions/checkout@v4
|
|
58
|
+
- name: Set up Python
|
|
59
|
+
uses: actions/setup-python@v5
|
|
60
|
+
with:
|
|
61
|
+
python-version: '3.12'
|
|
62
|
+
- name: Install dependencies
|
|
63
|
+
run: |
|
|
64
|
+
python -m pip install --upgrade pip
|
|
65
|
+
python -m pip install $GITHUB_WORKSPACE["test"]
|
|
66
|
+
- name: List of installed packages
|
|
67
|
+
run: |
|
|
68
|
+
python -m pip list
|
|
69
|
+
- name: Test with pytest
|
|
70
|
+
run: |
|
|
71
|
+
pytest -W error
|
|
72
|
+
|
|
73
|
+
tutorial_tests:
|
|
74
|
+
|
|
75
|
+
runs-on: ubuntu-latest
|
|
76
|
+
steps:
|
|
77
|
+
- uses: actions/checkout@v4
|
|
78
|
+
- name: Set up Python
|
|
79
|
+
uses: actions/setup-python@v5
|
|
80
|
+
with:
|
|
81
|
+
python-version: '3.11'
|
|
82
|
+
- name: Install dependencies
|
|
83
|
+
run: |
|
|
84
|
+
python -m pip install --upgrade pip
|
|
85
|
+
python -m pip install $GITHUB_WORKSPACE["all"]
|
|
86
|
+
- name: List of installed packages
|
|
87
|
+
run: |
|
|
88
|
+
python -m pip list
|
|
89
|
+
- name: Test with pytest
|
|
90
|
+
run: |
|
|
91
|
+
PYTHONPATH=$PYTHONPATH:$GITHUB_WORKSPACE python -m pytest --nbmake -n=auto --nbmake-timeout=900 "./tutorials"
|
|
92
|
+
|
|
93
|
+
tutorial_warnings_tests:
|
|
94
|
+
|
|
95
|
+
runs-on: ubuntu-latest
|
|
96
|
+
steps:
|
|
97
|
+
- uses: actions/checkout@v4
|
|
98
|
+
- name: Set up Python
|
|
99
|
+
uses: actions/setup-python@v5
|
|
100
|
+
with:
|
|
101
|
+
python-version: '3.12'
|
|
102
|
+
- name: Install dependencies
|
|
103
|
+
run: |
|
|
104
|
+
python -m pip install --upgrade pip
|
|
105
|
+
python -m pip install $GITHUB_WORKSPACE["all"]
|
|
106
|
+
- name: List of installed packages
|
|
107
|
+
run: |
|
|
108
|
+
python -m pip list
|
|
109
|
+
- name: Test with pytest
|
|
110
|
+
run: |
|
|
111
|
+
PYTHONPATH=$PYTHONPATH:$GITHUB_WORKSPACE python -m pytest -W error --nbmake -n=auto --nbmake-timeout=900 "./tutorials"
|
|
112
|
+
|
|
113
|
+
docs_check:
|
|
114
|
+
runs-on: ubuntu-latest
|
|
115
|
+
strategy:
|
|
116
|
+
matrix:
|
|
117
|
+
python-version: [ '3.9' ]
|
|
118
|
+
steps:
|
|
119
|
+
- uses: actions/checkout@v4
|
|
120
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
121
|
+
uses: actions/setup-python@v5
|
|
122
|
+
with:
|
|
123
|
+
python-version: ${{ matrix.python-version }}
|
|
124
|
+
- name: Check docs for Python ${{ matrix.python-version }}
|
|
125
|
+
uses: e2nIEE/sphinx-action@master
|
|
126
|
+
with:
|
|
127
|
+
pre-build-command: "python -m pip install --upgrade pip;
|
|
128
|
+
python -m pip install .[docs];"
|
|
129
|
+
build-command: "sphinx-build -b html . _build -W"
|
|
130
|
+
docs-folder: "doc/"
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# This workflow will create a Python package and upload it to testPyPi or PyPi
|
|
2
|
+
# Then, it installs simbench from there and all dependencies and runs tests with different Python versions
|
|
3
|
+
|
|
4
|
+
name: test
|
|
5
|
+
|
|
6
|
+
# Controls when the action will run.
|
|
7
|
+
on:
|
|
8
|
+
# Allows you to run this workflow manually from the Actions tab
|
|
9
|
+
push:
|
|
10
|
+
branches:
|
|
11
|
+
- release/*
|
|
12
|
+
|
|
13
|
+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
|
|
14
|
+
jobs:
|
|
15
|
+
|
|
16
|
+
build:
|
|
17
|
+
runs-on: ${{ matrix.os }}
|
|
18
|
+
strategy:
|
|
19
|
+
matrix:
|
|
20
|
+
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
|
|
21
|
+
os: [ ubuntu-latest, windows-latest ]
|
|
22
|
+
|
|
23
|
+
steps:
|
|
24
|
+
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
|
|
25
|
+
- uses: actions/checkout@v4
|
|
26
|
+
|
|
27
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
28
|
+
uses: actions/setup-python@v5
|
|
29
|
+
with:
|
|
30
|
+
python-version: ${{ matrix.python-version }}
|
|
31
|
+
|
|
32
|
+
- name: Install simbench & dependencies
|
|
33
|
+
run: |
|
|
34
|
+
python -m pip install --upgrade pip
|
|
35
|
+
python -m pip install pytest-split matplotlib geopandas
|
|
36
|
+
python -m pip install .["all"]
|
|
37
|
+
|
|
38
|
+
- name: Install specific dependencies (Windows)
|
|
39
|
+
if: matrix.os == 'windows-latest'
|
|
40
|
+
run: |
|
|
41
|
+
if ( '${{ matrix.python-version }}' -eq '3.9' ) { python -m pip install pypower }
|
|
42
|
+
if ( '${{ matrix.python-version }}' -ne '3.9' ) { python -m pip install numba }
|
|
43
|
+
if ( '${{ matrix.python-version }}' -eq '3.8' -or '${{ matrix.python-version }}' -eq '3.10' ) { python -m pip install lightsim2grid }
|
|
44
|
+
|
|
45
|
+
- name: Install specific dependencies (Ubuntu)
|
|
46
|
+
if: matrix.os == 'ubuntu-latest'
|
|
47
|
+
run: |
|
|
48
|
+
if ${{ matrix.python-version == '3.9' }}; then python -m pip install pypower; fi
|
|
49
|
+
if ${{ matrix.python-version != '3.9' }}; then python -m pip install numba; fi
|
|
50
|
+
if ${{ matrix.python-version == '3.8' || matrix.python-version == '3.10' }}; then python -m pip install lightsim2grid; fi
|
|
51
|
+
|
|
52
|
+
- name: List all installed packages
|
|
53
|
+
run: |
|
|
54
|
+
python -m pip list
|
|
55
|
+
|
|
56
|
+
- name: Test with pytest
|
|
57
|
+
run: |
|
|
58
|
+
python -m pytest --pyargs simbench.test
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# This workflow will create a Python package and upload it to testPyPi or PyPi
|
|
2
|
+
# Then, it installs simbench from there and all dependencies and runs tests with different Python versions
|
|
3
|
+
|
|
4
|
+
name: upload
|
|
5
|
+
|
|
6
|
+
# Controls when the action will run.
|
|
7
|
+
on:
|
|
8
|
+
# Allows you to run this workflow manually from the Actions tab
|
|
9
|
+
push:
|
|
10
|
+
branches:
|
|
11
|
+
- master
|
|
12
|
+
|
|
13
|
+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
|
|
14
|
+
jobs:
|
|
15
|
+
|
|
16
|
+
upload:
|
|
17
|
+
# The type of runner that the job will run on
|
|
18
|
+
runs-on: ubuntu-latest
|
|
19
|
+
|
|
20
|
+
# Steps represent a sequence of tasks that will be executed as part of the job
|
|
21
|
+
steps:
|
|
22
|
+
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
|
|
23
|
+
- uses: actions/checkout@v4
|
|
24
|
+
|
|
25
|
+
# Sets up python3
|
|
26
|
+
- uses: actions/setup-python@v5
|
|
27
|
+
with:
|
|
28
|
+
python-version: '3.10'
|
|
29
|
+
# Installs and upgrades pip, installs other dependencies and installs the package from setup.py
|
|
30
|
+
- name: Install dependencies
|
|
31
|
+
run: |
|
|
32
|
+
# Upgrade pip
|
|
33
|
+
python3 -m pip install --upgrade pip
|
|
34
|
+
# Install twine
|
|
35
|
+
python3 -m pip install setuptools wheel twine
|
|
36
|
+
|
|
37
|
+
# Upload to PyPI
|
|
38
|
+
- name: Build and Upload to PyPI
|
|
39
|
+
run: |
|
|
40
|
+
python3 setup.py sdist --formats=zip
|
|
41
|
+
twine check dist/* --strict
|
|
42
|
+
python3 -m twine upload dist/*
|
|
43
|
+
env:
|
|
44
|
+
TWINE_USERNAME: __token__
|
|
45
|
+
TWINE_PASSWORD: ${{ secrets.PYPI }}
|
|
46
|
+
TWINE_REPOSITORY: pypi
|
|
47
|
+
|
|
48
|
+
- name: Sleep for 150s to make release available
|
|
49
|
+
uses: juliangruber/sleep-action@v2
|
|
50
|
+
with:
|
|
51
|
+
time: 300s
|
|
@@ -1,6 +1,16 @@
|
|
|
1
1
|
Change Log
|
|
2
2
|
=============
|
|
3
3
|
|
|
4
|
+
[1.5.1] - 2024-04-08
|
|
5
|
+
----------------------
|
|
6
|
+
[FIXED] spelling mistake in pyproject.toml
|
|
7
|
+
|
|
8
|
+
[1.5.0] - 2024-04-08
|
|
9
|
+
----------------------
|
|
10
|
+
- [CHANGED] apply FutureWarnings of pandas 2.2
|
|
11
|
+
- [CHANGED] increase visibility of collect_all_simbench_codes()
|
|
12
|
+
- [CHANGED] setup.py -> pyproject.toml
|
|
13
|
+
|
|
4
14
|
[1.4.0] - 2023-05-12
|
|
5
15
|
----------------------
|
|
6
16
|
- [CHANGED] pandas 2.0 support
|
|
@@ -11,7 +21,7 @@ Change Log
|
|
|
11
21
|
----------------------
|
|
12
22
|
|
|
13
23
|
- [CHANGED] use GitHub-Ci instead of Travis-CI and update CI to python 3.8 and 3.9
|
|
14
|
-
- [CHANGED] adapt to pandas changes of version 1.2.0: deprecate
|
|
24
|
+
- [CHANGED] adapt to pandas changes of version 1.2.0: deprecate set operations for pandas Index
|
|
15
25
|
- [CHANGED] generalize (elm, col) recognizing in profiles dicts
|
|
16
26
|
- [CHANGED] output type of get_applied_profiles() and get_available_profiles() from list to set
|
|
17
27
|
- [ADDED] filter_unapplied_profiles_pp(), get_unused_profiles()
|
|
@@ -1,38 +1,83 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: simbench
|
|
3
|
-
Version: 1.
|
|
4
|
-
Summary: Electrical Power System Benchmark Models
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
Version: 1.5.1
|
|
4
|
+
Summary: Electrical Power System Benchmark Models.
|
|
5
|
+
Author-email: Steffen Meinecke <steffen.meinecke@uni-kassel.de>
|
|
6
|
+
Maintainer-email: simbench Developers <simbench@uni-kassel.de>
|
|
7
|
+
License: Copyright (c) 2019-2021 by University of Kassel, TU Dortmund, RWTH Aachen University and Fraunhofer Institute for Energy Economics and Energy System Technology (IEE) Kassel and individual contributors (see AUTHORS file for details).
|
|
8
|
+
All rights reserved.
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
The database called SimBench is made available under the Open Database
|
|
12
|
+
License: http://opendatacommons.org/licenses/odbl/1.0/.
|
|
13
|
+
Any rights in individual contents of the database are licensed under
|
|
14
|
+
the Database Contents License: http://opendatacommons.org/licenses/dbcl/1.0/
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
The code of this repository "simbench" is published under the following 3-clause BSD license:
|
|
18
|
+
|
|
19
|
+
Redistribution and use in source and binary forms, with or without modification, are permitted
|
|
20
|
+
provided that the following conditions are met:
|
|
21
|
+
|
|
22
|
+
1. Redistributions of source code must retain the above copyright notice, this list of conditions
|
|
23
|
+
and the following disclaimer.
|
|
24
|
+
|
|
25
|
+
2. Redistributions in binary form must reproduce the above copyright notice, this list of
|
|
26
|
+
conditions and the following disclaimer in the documentation and/or other materials provided
|
|
27
|
+
with the distribution.
|
|
28
|
+
|
|
29
|
+
3. Neither the name of the copyright holder nor the names of its contributors may be used to
|
|
30
|
+
endorse or promote products derived from this software without specific prior written permission.
|
|
31
|
+
|
|
32
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
|
|
33
|
+
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
|
34
|
+
FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
|
35
|
+
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
36
|
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
37
|
+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
38
|
+
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY
|
|
39
|
+
WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
40
|
+
|
|
41
|
+
Project-URL: Homepage, https://www.simbench.net
|
|
42
|
+
Project-URL: Documentation, https://simbench.readthedocs.io
|
|
43
|
+
Project-URL: Source, https://www.github.com/e2nIEE/simbench
|
|
44
|
+
Project-URL: Repository, https://www.github.com/e2nIEE/simbench.git
|
|
45
|
+
Project-URL: Issues, https://www.github.com/e2nIEE/simbench/issues
|
|
46
|
+
Project-URL: Download, https://pypi.org/project/simbench/#files
|
|
47
|
+
Project-URL: Changelog, https://github.com/e2nIEE/simbench/blob/develop/CHANGELOG.rst
|
|
48
|
+
Keywords: benchmark grid,power system,network,grid planning,grid operation,grid generation methodology,comparability,reproducibility,electricity,energy,engineering,simulation,simbench,time series,future scenarios
|
|
9
49
|
Classifier: Development Status :: 5 - Production/Stable
|
|
10
50
|
Classifier: Environment :: Console
|
|
11
51
|
Classifier: Intended Audience :: Developers
|
|
12
52
|
Classifier: Intended Audience :: Education
|
|
13
53
|
Classifier: Intended Audience :: Science/Research
|
|
54
|
+
Classifier: License :: OSI Approved :: BSD License
|
|
14
55
|
Classifier: Natural Language :: English
|
|
15
56
|
Classifier: Operating System :: OS Independent
|
|
16
57
|
Classifier: Programming Language :: Python
|
|
17
58
|
Classifier: Programming Language :: Python :: 3
|
|
18
59
|
Classifier: Programming Language :: Python :: 3.8
|
|
19
|
-
Classifier: Programming Language :: Python :: 3.1
|
|
20
60
|
Classifier: Programming Language :: Python :: 3.9
|
|
61
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
62
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
63
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
21
64
|
Requires-Python: >=3.8
|
|
22
65
|
Description-Content-Type: text/x-rst
|
|
23
66
|
Provides-Extra: docs
|
|
24
67
|
Provides-Extra: plotting
|
|
68
|
+
Provides-Extra: test
|
|
69
|
+
Provides-Extra: performance
|
|
70
|
+
Provides-Extra: fileio
|
|
25
71
|
Provides-Extra: tutorials
|
|
26
72
|
Provides-Extra: all
|
|
27
73
|
License-File: LICENSE
|
|
74
|
+
License-File: AUTHORS
|
|
28
75
|
|
|
29
76
|
|
|
30
77
|
.. image:: https://simbench.de/wp-content/uploads/2019/01/logo.png
|
|
31
78
|
:target: https://www.simbench.net
|
|
32
79
|
:alt: SimBench logo
|
|
33
80
|
|
|
34
|
-
|
|
|
35
|
-
|
|
36
81
|
.. image:: https://badge.fury.io/py/simbench.svg
|
|
37
82
|
:target: https://pypi.python.org/pypi/simbench
|
|
38
83
|
:alt: PyPI
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["build", "wheel", "setuptools"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "simbench"
|
|
7
|
+
version = "1.5.1" # File format version '__format_version__' is tracked in _version.py
|
|
8
|
+
authors = [
|
|
9
|
+
{ name = "Steffen Meinecke", email = "steffen.meinecke@uni-kassel.de" }
|
|
10
|
+
]
|
|
11
|
+
maintainers = [
|
|
12
|
+
{ name = "simbench Developers", email = "simbench@uni-kassel.de" }
|
|
13
|
+
]
|
|
14
|
+
description = "Electrical Power System Benchmark Models."
|
|
15
|
+
readme = "README.rst"
|
|
16
|
+
license = { file = "LICENSE" }
|
|
17
|
+
requires-python = ">=3.8"
|
|
18
|
+
classifiers = [
|
|
19
|
+
"Development Status :: 5 - Production/Stable",
|
|
20
|
+
"Environment :: Console",
|
|
21
|
+
"Intended Audience :: Developers",
|
|
22
|
+
"Intended Audience :: Education",
|
|
23
|
+
"Intended Audience :: Science/Research",
|
|
24
|
+
"License :: OSI Approved :: BSD License",
|
|
25
|
+
"Natural Language :: English",
|
|
26
|
+
"Operating System :: OS Independent",
|
|
27
|
+
"Programming Language :: Python",
|
|
28
|
+
"Programming Language :: Python :: 3",
|
|
29
|
+
# Add the specific Python versions supported here, e.g.:
|
|
30
|
+
"Programming Language :: Python :: 3.8",
|
|
31
|
+
"Programming Language :: Python :: 3.9",
|
|
32
|
+
"Programming Language :: Python :: 3.10",
|
|
33
|
+
"Programming Language :: Python :: 3.11",
|
|
34
|
+
"Programming Language :: Python :: 3.12"
|
|
35
|
+
]
|
|
36
|
+
dependencies = [
|
|
37
|
+
"pandapower>=2.12.1"
|
|
38
|
+
]
|
|
39
|
+
keywords = [
|
|
40
|
+
"benchmark grid", "power system", "network", "grid planning", "grid operation", "grid generation methodology", "comparability", "reproducibility", "electricity", "energy", "engineering", "simulation", "simbench", "time series", "future scenarios"
|
|
41
|
+
]
|
|
42
|
+
|
|
43
|
+
[project.urls]
|
|
44
|
+
Homepage = "https://www.simbench.net"
|
|
45
|
+
Documentation = "https://simbench.readthedocs.io"
|
|
46
|
+
Source = "https://www.github.com/e2nIEE/simbench"
|
|
47
|
+
Repository = "https://www.github.com/e2nIEE/simbench.git"
|
|
48
|
+
Issues = "https://www.github.com/e2nIEE/simbench/issues"
|
|
49
|
+
Download = "https://pypi.org/project/simbench/#files"
|
|
50
|
+
Changelog = "https://github.com/e2nIEE/simbench/blob/develop/CHANGELOG.rst"
|
|
51
|
+
|
|
52
|
+
[project.optional-dependencies]
|
|
53
|
+
docs = ["numpydoc", "sphinx", "sphinx_rtd_theme", "sphinx-pyproject"]
|
|
54
|
+
plotting = ["plotly>=3.1.1", "matplotlib", "igraph", "geopandas", "geojson"]
|
|
55
|
+
test = ["pytest~=8.1", "pytest-xdist", "nbmake"]
|
|
56
|
+
performance = ["ortools", "numba>=0.25", "lightsim2grid>=0.8.1"]
|
|
57
|
+
fileio = ["geopandas"]
|
|
58
|
+
tutorials = ["matplotlib"]
|
|
59
|
+
all = [
|
|
60
|
+
"plotly>=3.1.1", "matplotlib", "igraph", "geopandas", "geojson",
|
|
61
|
+
"pytest~=8.1", "pytest-xdist", "nbmake",
|
|
62
|
+
"ortools", "numba>=0.25", "lightsim2grid>=0.8.1",
|
|
63
|
+
"geopandas",
|
|
64
|
+
"matplotlib"
|
|
65
|
+
]
|
|
66
|
+
# "shapely", "pyproj", "fiona" are dependencies of geopandas and should be already available
|
|
67
|
+
|
|
68
|
+
[tool.setuptools.packages.find]
|
|
69
|
+
where = ["simbench"]
|
|
70
|
+
|
|
71
|
+
[tool.pytest.ini_options]
|
|
72
|
+
addopts = ["--strict-markers"]
|
|
73
|
+
markers = [
|
|
74
|
+
"slow: marks tests as slow (deselect with '-m \"not slow\"'), e.g. in run_fast_tests"
|
|
75
|
+
]
|
simbench-1.5.1/setup.py
ADDED
|
@@ -29,6 +29,18 @@ def ensure_iterability(var, len_=None):
|
|
|
29
29
|
return var
|
|
30
30
|
|
|
31
31
|
|
|
32
|
+
def to_numeric_ignored_errors(data):
|
|
33
|
+
if isinstance(data, pd.Series):
|
|
34
|
+
try:
|
|
35
|
+
return pd.to_numeric(data)
|
|
36
|
+
except (ValueError, TypeError):
|
|
37
|
+
return data
|
|
38
|
+
elif isinstance(data, pd.DataFrame):
|
|
39
|
+
return pd.concat([to_numeric_ignored_errors(data[col]) for col in data.columns], axis=1)
|
|
40
|
+
else:
|
|
41
|
+
raise TypeError(f"{type(data)=} is not a pandas.Series or a pandas.DataFrame.")
|
|
42
|
+
|
|
43
|
+
|
|
32
44
|
def find_idx_by_name(df, column, name):
|
|
33
45
|
idx = df.index[df[column] == name]
|
|
34
46
|
if len(idx) == 0:
|
|
@@ -95,13 +107,11 @@ def merge_dataframes(dfs, keep="first", sort_index=True, sort_column=True, colum
|
|
|
95
107
|
if kwargs["axis"] != 0:
|
|
96
108
|
logger.warning("'axis' is always assumed as zero.")
|
|
97
109
|
kwargs.pop("axis")
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
logger.warning("'sort' overwrites 'sort_index' and 'sort_column'.")
|
|
104
|
-
kwargs.pop("sort")
|
|
110
|
+
sort = kwargs.get("sort", None)
|
|
111
|
+
if sort is not None:
|
|
112
|
+
raise KeyError(
|
|
113
|
+
"merge_dataframes() does not support parameter 'sort' anymore. Please pass "
|
|
114
|
+
f"sort_index={sort} and sort_column={sort}.")
|
|
105
115
|
|
|
106
116
|
# --- set index_column as index
|
|
107
117
|
if column_to_sort is not None:
|
|
@@ -211,7 +221,7 @@ def ensure_full_column_data_existence(dict_, tablename, column):
|
|
|
211
221
|
"""
|
|
212
222
|
missing_data = dict_[tablename].index[dict_[tablename][column].isnull()]
|
|
213
223
|
# fill missing data by tablename+index, e.g. "Bus 2"
|
|
214
|
-
dict_[tablename]
|
|
224
|
+
dict_[tablename].loc[missing_data, column] = [tablename + ' %s' % n for n in (
|
|
215
225
|
missing_data.values + 1)]
|
|
216
226
|
return dict_[tablename]
|
|
217
227
|
|
|
@@ -219,9 +229,9 @@ def ensure_full_column_data_existence(dict_, tablename, column):
|
|
|
219
229
|
def avoid_duplicates_in_column(dict_, tablename, column):
|
|
220
230
|
""" Avoids duplicates in given column (as type string) of a dict's DataFrame """
|
|
221
231
|
query = dict_[tablename][column].duplicated(keep=False)
|
|
222
|
-
for double in dict_[tablename]
|
|
232
|
+
for double in dict_[tablename].loc[query, column].unique():
|
|
223
233
|
idx = dict_[tablename][column].index[dict_[tablename][column] == double]
|
|
224
|
-
dict_[tablename]
|
|
234
|
+
dict_[tablename].loc[idx, column] = [double + " (%i)" % i for i in range(len(idx))]
|
|
225
235
|
if sum(dict_[tablename][column].duplicated()):
|
|
226
236
|
raise ValueError("The renaming by 'double + int' was not appropriate to remove all " +
|
|
227
237
|
"duplicates.")
|
|
@@ -285,3 +295,10 @@ def append_str_by_underline_count(str_series, append_only_duplicates=False, coun
|
|
|
285
295
|
appended_strings.index = str_series.index
|
|
286
296
|
reserved_strings = set(series[all_dupl])
|
|
287
297
|
return appended_strings, reserved_strings
|
|
298
|
+
|
|
299
|
+
|
|
300
|
+
def repl_nans_in_obj_cols_to_empty_str(net):
|
|
301
|
+
for df in net.values():
|
|
302
|
+
if isinstance(df, pd.DataFrame) and np.prod(df.shape):
|
|
303
|
+
obj_cols = df.select_dtypes(include=object).columns
|
|
304
|
+
df[obj_cols] = df[obj_cols].fillna("")
|
|
@@ -52,7 +52,7 @@ def _ensure_single_switch_at_aux_node_and_copy_vm_setp(csv_data, new_type_name="
|
|
|
52
52
|
idx_nodes_dupl_sw = csv_data["Node"].index[dupl_node_ids & aux_node_ids]
|
|
53
53
|
|
|
54
54
|
# rename node type
|
|
55
|
-
csv_data["Node"].
|
|
55
|
+
csv_data["Node"].loc[idx_nodes_dupl_sw, "type"] = new_type_name
|
|
56
56
|
|
|
57
57
|
for X, Y in zip(["nodeA", "nodeB"], ["nodeB", "nodeA"]):
|
|
58
58
|
# get indices to copy the setpoint
|
|
@@ -71,7 +71,7 @@ def _ensure_single_switch_at_aux_node_and_copy_vm_setp(csv_data, new_type_name="
|
|
|
71
71
|
idx_node_dupl = idx_X_pd.duplicated()
|
|
72
72
|
|
|
73
73
|
# set setpoint
|
|
74
|
-
csv_data["Node"].
|
|
74
|
+
csv_data["Node"].loc[idx_X[idx_node_dupl], "vmSetp"] = csv_data["Node"].vmSetp.loc[
|
|
75
75
|
idx_Y[idx_node_dupl]].values
|
|
76
76
|
|
|
77
77
|
|
|
@@ -87,14 +87,14 @@ def _ensure_single_switch_at_aux_node_and_copy_vm_setp(csv_data, new_type_name="
|
|
|
87
87
|
# dupl_sw_node = sw_nodes[sw_nodes.duplicated()]
|
|
88
88
|
# dupl_node_ids = csv_data["Node"].id.isin(dupl_sw_node)
|
|
89
89
|
# aux_node_ids = csv_data["Node"].type == "auxiliary"
|
|
90
|
-
# csv_data["Node"].
|
|
90
|
+
# csv_data["Node"].loc[dupl_node_ids & aux_node_ids, "type"] = new_type_name
|
|
91
91
|
# naive coding:
|
|
92
92
|
# aux_ids = csv_data["Node"].id[csv_data["Node"].type == "auxiliary"].values
|
|
93
93
|
# multi_sw_ids = [aux_id for aux_id in aux_ids if sum(
|
|
94
94
|
# (csv_data["Switch"].nodeA.values == aux_id) |
|
|
95
95
|
# (csv_data["Switch"].nodeB.values == aux_id)) > 1]
|
|
96
96
|
# multi_sw_idx = csv_data["Node"].index[csv_data["Node"].id.isin(multi_sw_ids)]
|
|
97
|
-
# csv_data["Node"].
|
|
97
|
+
# csv_data["Node"].loc[multi_sw_idx, "type"] = new_type_name
|
|
98
98
|
|
|
99
99
|
|
|
100
100
|
def _sort_switch_nodes_and_prepare_element_and_et(csv_data):
|
|
@@ -113,9 +113,9 @@ def _sort_switch_nodes_and_prepare_element_and_et(csv_data):
|
|
|
113
113
|
|
|
114
114
|
# --- swap nodeA data if there are auxiliary node names
|
|
115
115
|
nodeA_data = deepcopy(csv_data["Switch"].nodeA[nodeA_is_aux_node])
|
|
116
|
-
csv_data["Switch"].
|
|
116
|
+
csv_data["Switch"].loc[nodeA_is_aux_node, "nodeA"] = csv_data["Switch"].nodeB[
|
|
117
117
|
nodeA_is_aux_node]
|
|
118
|
-
csv_data["Switch"].
|
|
118
|
+
csv_data["Switch"].loc[nodeA_is_aux_node, "nodeB"] = nodeA_data
|
|
119
119
|
|
|
120
120
|
# --- prepare 'element' and 'et' columns
|
|
121
121
|
csv_data["Switch"]["et"] = "b"
|
|
@@ -126,7 +126,7 @@ def _sort_switch_nodes_and_prepare_element_and_et(csv_data):
|
|
|
126
126
|
def _correct_autoTapSide_of_nonTapTrafos(csv_data):
|
|
127
127
|
for elm in ["Transformer", "Transformer3W"]:
|
|
128
128
|
nonTapTrafos = ~csv_data[elm].autoTap.astype(bool)
|
|
129
|
-
csv_data[elm].
|
|
129
|
+
csv_data[elm].loc[nonTapTrafos, "autoTapSide"] = None
|
|
130
130
|
|
|
131
131
|
|
|
132
132
|
def _add_phys_type_and_vm_va_setpoints_to_element_tables(csv_data):
|