Skip to content

Commit 45259b6

Browse files
committed
Merge branch 'main' of https://github.com/PowerGridModel/power-grid-model-ds into feat/improve_get_components
2 parents 89d6341 + d28aba7 commit 45259b6

File tree

12 files changed

+389
-132
lines changed

12 files changed

+389
-132
lines changed

.github/workflows/citations.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# SPDX-FileCopyrightText: Contributors to the Power Grid Model project <[email protected]>
2+
#
3+
# SPDX-License-Identifier: MPL-2.0
4+
5+
name: Validate citation
6+
7+
on:
8+
# run pipeline on push event of main branch, or when CITATIONS path has changed
9+
push:
10+
branches:
11+
- main
12+
paths:
13+
- CITATION.cff
14+
- .github/workflows/citations.yml
15+
pull_request:
16+
paths:
17+
- CITATION.cff
18+
- .github/workflows/citations.yml
19+
# run pipeline from another workflow
20+
workflow_call:
21+
# run this workflow manually from the Actions tab
22+
workflow_dispatch:
23+
24+
concurrency:
25+
group: ${{ github.workflow }}-${{ github.ref }}-citations
26+
cancel-in-progress: true
27+
28+
jobs:
29+
validate-citations:
30+
runs-on: ubuntu-24.04
31+
steps:
32+
- name: checkout
33+
uses: actions/checkout@v4
34+
- name: Install R
35+
run: |
36+
sudo apt-get update && sudo apt-get install -y r-base
37+
- name: Validate CITATION.cff
38+
uses: dieghernan/cff-validator@v4

CITATION.cff

Lines changed: 174 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,174 @@
1+
# SPDX-FileCopyrightText: Contributors to the Power Grid Model project <[email protected]>
2+
#
3+
# SPDX-License-Identifier: MPL-2.0
4+
5+
cff-version: 1.2.0
6+
message: "If you are using Power Grid Model in your research work, please consider citing our library as below."
7+
8+
title: "PowerGridModel/power-grid-model-ds"
9+
url: "https://github.com/PowerGridModel/power-grid-model-ds"
10+
license: "MPL-2.0"
11+
authors:
12+
- family-names: "Schouten"
13+
given-names: "Jaap"
14+
15+
affiliation: "Alliander"
16+
- family-names: "Baaijen"
17+
given-names: "Thijs"
18+
19+
affiliation: "Alliander"
20+
- family-names: "Koppen"
21+
given-names: "Vincent"
22+
23+
- family-names: "Voort"
24+
name-particle: "van der"
25+
given-names: "Sven"
26+
27+
- name: "Contributors to the LF Energy project Power Grid Model"
28+
contact:
29+
- name: "LF Energy project Power Grid Model"
30+
31+
32+
references:
33+
- title: "PowerGridModel/power-grid-model"
34+
repository-code: "https://github.com/PowerGridModel/power-grid-model"
35+
doi: "10.5281/zenodo.8054429"
36+
license: "MPL-2.0"
37+
type: software-code
38+
authors:
39+
- family-names: "Xiang"
40+
given-names: "Yu"
41+
42+
affiliation: "Alliander"
43+
- family-names: "Salemink"
44+
given-names: "Peter"
45+
46+
affiliation: "Alliander"
47+
- family-names: "Westering"
48+
name-particle: "van"
49+
given-names: "Werner"
50+
51+
affiliation: "Alliander"
52+
- family-names: "Bharambe"
53+
given-names: "Nitish"
54+
55+
affiliation: "Alliander"
56+
- family-names: "Govers"
57+
given-names: "Martinus"
58+
59+
affiliation: "Alliander"
60+
orcid: "https://orcid.org/0009-0008-6890-8353"
61+
- family-names: "Bogaard"
62+
name-particle: "van den"
63+
given-names: "Jonas"
64+
65+
affiliation: "Alliander"
66+
- family-names: "Stoeller"
67+
given-names: "Bram"
68+
- family-names: "Wang"
69+
given-names: "Zhen"
70+
71+
affiliation: "Alliander"
72+
- family-names: "Guo"
73+
given-names: "Jerry"
74+
75+
affiliation: "Alliander"
76+
- family-names: "Jagutis"
77+
given-names: "Laurynas"
78+
79+
affiliation: "Alliander"
80+
- family-names: "Wang"
81+
given-names: "Chenguang"
82+
83+
affiliation: "Alliander"
84+
- family-names: "Raalte"
85+
name-particle: "van"
86+
given-names: "Marc"
87+
88+
affiliation: "Alliander"
89+
- family-names: "Figueroa Manrique"
90+
given-names: "Santiago"
91+
92+
affiliation: "Alliander"
93+
- name: "Contributors to the LF Energy project Power Grid Model"
94+
95+
- title: "Power grid model: A high-performance distribution grid calculation library"
96+
doi: "10.1049/icp.2023.0633"
97+
authors:
98+
- family-names: "Xiang"
99+
given-names: "Yu"
100+
101+
affiliation: "Alliander"
102+
- family-names: "Salemink"
103+
given-names: "Peter"
104+
105+
affiliation: "Alliander"
106+
- family-names: "Stoeller"
107+
given-names: "Bram"
108+
- family-names: "Bharambe"
109+
given-names: "Nitish"
110+
111+
affiliation: "Alliander"
112+
- family-names: "Westering"
113+
name-particle: "van"
114+
given-names: "Werner"
115+
116+
affiliation: "Alliander"
117+
conference:
118+
name: "CIRED 2023 - The 27th International Conference and Exhibition on Electricity Distribution"
119+
type: conference-paper
120+
year: 2023
121+
volume: 2023
122+
pages: "1-5"
123+
124+
- title: "PowerGridModel/power-grid-model-io"
125+
repository-code: "https://github.com/PowerGridModel/power-grid-model-io"
126+
doi: "10.5281/zenodo.8059257"
127+
license: "MPL-2.0"
128+
type: software-code
129+
authors:
130+
- family-names: "Xiang"
131+
given-names: "Yu"
132+
133+
affiliation: "Alliander"
134+
- family-names: "Salemink"
135+
given-names: "Peter"
136+
137+
affiliation: "Alliander"
138+
- family-names: "Bharambe"
139+
given-names: "Nitish"
140+
141+
affiliation: "Alliander"
142+
- family-names: "Govers"
143+
given-names: "Martinus"
144+
145+
affiliation: "Alliander"
146+
orcid: "https://orcid.org/0009-0008-6890-8353"
147+
- family-names: "Bogaard"
148+
name-particle: "van den"
149+
given-names: "Jonas"
150+
151+
affiliation: "Alliander"
152+
- family-names: "Stoeller"
153+
given-names: "Bram"
154+
- family-names: "Wang"
155+
given-names: "Zhen"
156+
157+
affiliation: "Alliander"
158+
- family-names: "Guo"
159+
given-names: "Jerry"
160+
161+
affiliation: "Alliander"
162+
- family-names: "Jagutis"
163+
given-names: "Laurynas"
164+
165+
affiliation: "Alliander"
166+
- family-names: "Wang"
167+
given-names: "Chenguang"
168+
169+
affiliation: "Alliander"
170+
- family-names: "Figueroa Manrique"
171+
given-names: "Santiago"
172+
173+
affiliation: "Alliander"
174+
- name: "Contributors to the LF Energy project Power Grid Model"

src/power_grid_model_ds/_core/model/graphs/container.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
import dataclasses
88
from dataclasses import dataclass
9-
from pathlib import PosixPath
109
from typing import Generator
1110

1211
import numpy as np
@@ -119,15 +118,6 @@ def make_inactive(self, branch: BranchArray) -> None:
119118
graph.delete_branch(from_ext_node_id=from_node, to_ext_node_id=to_node)
120119
setattr(self, field.name, graph)
121120

122-
def cache(self, cache_dir: PosixPath, compress: bool) -> PosixPath:
123-
"""Cache the container into a folder with .pkl and graph files"""
124-
cache_dir.mkdir(parents=True, exist_ok=True)
125-
126-
for field in self.graph_attributes:
127-
graph = getattr(self, field.name)
128-
graph.cache(cache_dir=cache_dir, graph_name=field.name, compress=compress)
129-
return cache_dir
130-
131121
@classmethod
132122
def from_arrays(cls, arrays: MinimalGridArrays) -> "GraphContainer":
133123
"""Build from arrays"""

src/power_grid_model_ds/_core/model/graphs/models/base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,9 +175,9 @@ def delete_branch_array(self, branch_array: BranchArray, raise_on_fail: bool = T
175175
if self._branch_is_relevant(branch):
176176
self.delete_branch(branch.from_node.item(), branch.to_node.item(), raise_on_fail=raise_on_fail)
177177

178-
def delete_branch3_array(self, branch_array: Branch3Array, raise_on_fail: bool = True) -> None:
178+
def delete_branch3_array(self, branch3_array: Branch3Array, raise_on_fail: bool = True) -> None:
179179
"""Delete all branch3s in the branch3 array from the graph."""
180-
for branch3 in branch_array:
180+
for branch3 in branch3_array:
181181
branches = _get_branch3_branches(branch3)
182182
self.delete_branch_array(branches, raise_on_fail=raise_on_fail)
183183

tests/performance/_constants.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,18 @@
66
"dtype = [('id', '<i8'), ('test_int', '<i8'), ('test_float', '<f8'), ('test_str', '<U50'), ('test_bool', '?')]; "
77
)
88

9-
SETUP_CODES = {
10-
"structured": "import numpy as np;" + NUMPY_DTYPE + "input_array = np.zeros({array_size}, dtype=dtype)",
11-
"rec": "import numpy as np;" + NUMPY_DTYPE + "input_array = np.recarray(({array_size},),dtype=dtype)",
12-
"fancy": "from tests.conftest import FancyTestArray; input_array=FancyTestArray.zeros({array_size});"
13-
+ "import numpy as np;input_array.id = np.arange({array_size})",
9+
ARRAY_SETUP_CODES = {
10+
"structured": "import numpy as np;" + NUMPY_DTYPE + "input_array = np.zeros({size}, dtype=dtype)",
11+
"rec": "import numpy as np;" + NUMPY_DTYPE + "input_array = np.recarray(({size},),dtype=dtype)",
12+
"fancy": "from tests.conftest import FancyTestArray; input_array=FancyTestArray.zeros({size});"
13+
+ "import numpy as np;input_array.id = np.arange({size})",
1414
}
1515

1616
GRAPH_SETUP_CODES = {
1717
"rustworkx": "from power_grid_model_ds import Grid;"
1818
+ "from power_grid_model_ds.generators import RadialGridGenerator;"
1919
+ "from power_grid_model_ds.graph_models import RustworkxGraphModel;"
20-
+ "grid=RadialGridGenerator(nr_nodes={graph_size}, grid_class=Grid, graph_model=RustworkxGraphModel).run()",
20+
+ "grid=RadialGridGenerator(nr_nodes={size}, grid_class=Grid, graph_model=RustworkxGraphModel).run()",
2121
}
2222

2323
SINGLE_REPEATS = 1000

0 commit comments

Comments
 (0)