Skip to content

Commit 7b1bf40

Browse files
authored
Merge branch 'main' into feature/attached-components-visualizer
2 parents 2f04ffe + c3afcdb commit 7b1bf40

50 files changed

Lines changed: 694 additions & 397 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/check-code-quality.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ jobs:
2727
python-version: ["3.12", "3.13", "3.14"]
2828
steps:
2929
- name: Checkout source code
30-
uses: actions/checkout@v6
30+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
3131

3232
- name: Install uv
33-
uses: astral-sh/setup-uv@v7
33+
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
3434
if: ${{ always() }}
3535
with:
3636
activate-environment: true

.github/workflows/ci.yml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@ jobs:
3535
version: ${{ steps.version.outputs.version }}
3636
steps:
3737
- name: Checkout source code
38-
uses: actions/checkout@v6
38+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
3939

4040
- name: Install uv
41-
uses: astral-sh/setup-uv@v7
41+
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
4242
if: ${{ always() }}
4343
with:
4444
activate-environment: true
@@ -49,7 +49,7 @@ jobs:
4949
run: uv sync --frozen
5050

5151
- name: Set PyPI version
52-
uses: PowerGridModel/pgm-version-bump@main
52+
uses: PowerGridModel/pgm-version-bump@b75ff549cae00be1ca859d181dbc460f69003643 # v0.1.2
5353
with:
5454
token: ${{ secrets.GITHUB_TOKEN }}
5555

@@ -62,7 +62,7 @@ jobs:
6262
uv build
6363
6464
- name: Store built wheel file
65-
uses: actions/upload-artifact@v7
65+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
6666
with:
6767
name: power-grid-model-ds
6868
path: dist/
@@ -78,10 +78,10 @@ jobs:
7878
runs-on: ${{ matrix.os }}
7979
steps:
8080
- name: Checkout source code
81-
uses: actions/checkout@v6
81+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
8282

8383
- name: Install uv
84-
uses: astral-sh/setup-uv@v7
84+
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
8585
if: ${{ always() }}
8686
with:
8787
activate-environment: true
@@ -91,7 +91,7 @@ jobs:
9191
run: uv tool install poethepoet
9292

9393
- name: Load built wheel file
94-
uses: actions/download-artifact@v8
94+
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
9595
with:
9696
name: power-grid-model-ds
9797
path: dist/
@@ -114,10 +114,10 @@ jobs:
114114
tag: ${{ steps.tag.outputs.tag }}
115115
steps:
116116
- name: Checkout source code
117-
uses: actions/checkout@v6
117+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
118118

119119
- name: Load built wheel file
120-
uses: actions/download-artifact@v8
120+
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
121121
with:
122122
name: power-grid-model-ds
123123
path: dist/
@@ -132,7 +132,7 @@ jobs:
132132
run: echo "${{ steps.tag.outputs.tag }}"
133133

134134
- name: Release
135-
uses: softprops/action-gh-release@v2
135+
uses: softprops/action-gh-release@b4309332981a82ec1c5618f44dd2e27cc8bfbfda # v3.0.0
136136
with:
137137
files: |
138138
./dist/*
@@ -161,7 +161,7 @@ jobs:
161161
run: ls -la assets-to-publish
162162

163163
- name: Upload assets to PyPI
164-
uses: pypa/gh-action-pypi-publish@release/v1
164+
uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b # v1.14.0
165165
with:
166166
# To test, use the TestPyPI:
167167
# repository-url: https://test.pypi.org/legacy/

.github/workflows/citations.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
runs-on: ubuntu-24.04
3131
steps:
3232
- name: checkout
33-
uses: actions/checkout@v6
33+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
3434

3535
- name: Validate CITATION.cff
36-
uses: dieghernan/cff-validator@v4
36+
uses: dieghernan/cff-validator@54c8e737314b948f25c0e5524a9d8ae3f39b207b # v5.0.1

.github/workflows/reuse-compliance.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,6 @@ jobs:
1818
runs-on: ubuntu-latest
1919
steps:
2020
- name: checkout
21-
uses: actions/checkout@v6
21+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
2222
- name: REUSE Compliance Check
23-
uses: fsfe/reuse-action@v6
23+
uses: fsfe/reuse-action@676e2d560c9a403aa252096d99fcab3e1132b0f5 # v6.0.0

.github/workflows/sonar.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ jobs:
2323
steps:
2424

2525
- name: Checkout source code
26-
uses: actions/checkout@v6
26+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
2727

2828
- name: Install uv
29-
uses: astral-sh/setup-uv@v7
29+
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
3030
if: ${{ always() }}
3131
with:
3232
activate-environment: true
@@ -46,7 +46,7 @@ jobs:
4646
4747
- name: SonarCloud Scan
4848
if: ${{ (github.event_name == 'push') || (github.event.pull_request.head.repo.owner.login == 'PowerGridModel') }}
49-
uses: SonarSource/sonarqube-scan-action@v7
49+
uses: SonarSource/sonarqube-scan-action@59db25f34e16620e48ab4bb9e4a5dce155cb5432 # v8.0.0
5050
env:
5151
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5252
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

docs/demos/connecting_new_consumer.ipynb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
"outputs": [],
2121
"source": [
2222
"from dataclasses import dataclass\n",
23+
"from typing import ClassVar\n",
2324
"\n",
2425
"import numpy as np\n",
2526
"from numpy.typing import NDArray\n",
@@ -31,7 +32,7 @@
3132
"class ExtendedNodeArray(NodeArray):\n",
3233
" \"\"\"Extends the node array with the simulated voltage and coordinates\"\"\"\n",
3334
"\n",
34-
" _defaults = {\"u\": 0}\n",
35+
" _defaults: ClassVar = {\"u\": 0}\n",
3536
"\n",
3637
" u: NDArray[np.float64]\n",
3738
" x_coor: NDArray[np.float64]\n",
@@ -45,7 +46,7 @@
4546
"class ExtendedLineArray(LineArray):\n",
4647
" \"\"\"Extends the line array with current output\"\"\"\n",
4748
"\n",
48-
" _defaults = {\"i_from\": 0}\n",
49+
" _defaults: ClassVar = {\"i_from\": 0}\n",
4950
"\n",
5051
" i_from: NDArray[np.float64]\n",
5152
"\n",

docs/examples/model/array_examples.ipynb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
"metadata": {},
2222
"outputs": [],
2323
"source": [
24+
"from typing import ClassVar\n",
25+
"\n",
2426
"import numpy as np\n",
2527
"from numpy.typing import NDArray\n",
2628
"\n",
@@ -196,7 +198,7 @@
196198
"source": [
197199
"class CustomStrLengthArray(FancyArray):\n",
198200
" test_str: NDArray[np.str_]\n",
199-
" _str_lengths = {\"test_str\": 100}\n",
201+
" _str_lengths: ClassVar = {\"test_str\": 100}\n",
200202
"\n",
201203
"\n",
202204
"custom_array = CustomStrLengthArray(test_str=[\"a\" * 100])"

docs/examples/model/grid_extensions_examples.ipynb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
"metadata": {},
2222
"outputs": [],
2323
"source": [
24+
"from typing import ClassVar\n",
25+
"\n",
2426
"import numpy as np\n",
2527
"from numpy.typing import NDArray\n",
2628
"\n",
@@ -30,15 +32,15 @@
3032
"class ExtendedNodeArray(NodeArray):\n",
3133
" \"\"\"Extends the node array with an output value\"\"\"\n",
3234
"\n",
33-
" _defaults = {\"u\": 0}\n",
35+
" _defaults: ClassVar = {\"u\": 0}\n",
3436
"\n",
3537
" u: NDArray[np.float64]\n",
3638
"\n",
3739
"\n",
3840
"class ExtendedLineArray(LineArray):\n",
3941
" \"\"\"Extends the line array with an output value\"\"\"\n",
4042
"\n",
41-
" _defaults = {\"i_from\": 0}\n",
43+
" _defaults: ClassVar = {\"i_from\": 0}\n",
4244
"\n",
4345
" i_from: NDArray[np.float64]"
4446
]

docs/examples/pgm/basic_pgm_examples.ipynb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@
6868
"outputs": [],
6969
"source": [
7070
"from dataclasses import dataclass\n",
71+
"from typing import ClassVar\n",
7172
"\n",
7273
"import numpy as np\n",
7374
"from numpy.typing import NDArray\n",
@@ -79,15 +80,15 @@
7980
"class ExtendedNodeArray(NodeArray):\n",
8081
" \"\"\"Extends the node array with an output value\"\"\"\n",
8182
"\n",
82-
" _defaults = {\"u\": 0}\n",
83+
" _defaults: ClassVar = {\"u\": 0}\n",
8384
"\n",
8485
" u: NDArray[np.float64]\n",
8586
"\n",
8687
"\n",
8788
"class ExtendedLineArray(LineArray):\n",
8889
" \"\"\"Extends the line array with an output value\"\"\"\n",
8990
"\n",
90-
" _defaults = {\"i_from\": 0}\n",
91+
" _defaults: ClassVar = {\"i_from\": 0}\n",
9192
"\n",
9293
" i_from: NDArray[np.float64]\n",
9394
"\n",

docs/model_interface.ipynb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,8 @@
117117
"metadata": {},
118118
"outputs": [],
119119
"source": [
120+
"from typing import ClassVar\n",
121+
"\n",
120122
"import numpy as np\n",
121123
"from numpy.typing import NDArray\n",
122124
"\n",
@@ -143,7 +145,7 @@
143145
"outputs": [],
144146
"source": [
145147
"class MyDefaultedArray(MyArray):\n",
146-
" _defaults = {\"id\": -1, \"name\": \"default\", \"value\": 1.0}"
148+
" _defaults: ClassVar = {\"id\": -1, \"name\": \"default\", \"value\": 1.0}"
147149
]
148150
},
149151
{
@@ -181,7 +183,7 @@
181183
"source": [
182184
"class MyArray(FancyArray):\n",
183185
" name: NDArray[np.str_]\n",
184-
" _str_lengths = {\"name\": 100}"
186+
" _str_lengths: ClassVar = {\"name\": 100}"
185187
]
186188
},
187189
{

0 commit comments

Comments
 (0)