Moez98 commited on
Commit
0713efa
·
verified ·
1 Parent(s): c4a74c8

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +266 -0
README.md CHANGED
@@ -1,3 +1,269 @@
1
  ---
2
  license: mit
3
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
  license: mit
3
  ---
4
+
5
+ # PowerDiT Dataset
6
+
7
+ This repository contains processed power-system graph data for machine learning experiments on power-flow- and optimal-power-flow-related tasks.
8
+ The data is generated with [**gridfm-datakit**](https://github.com/gridfm/gridfm-datakit) based on benchmark grid cases from [**PGLib**](https://github.com/power-grid-lib/pglib-opf), and then preprocessed into graph-structured samples.
9
+ It is intended to be stored in the folders examples/data_processed/pf and examples/data_processed/opf.
10
+
11
+ ## Overview
12
+
13
+ The dataset consists of graph representations of electric power systems under a range of operating conditions and perturbations.
14
+
15
+ Each sample corresponds to a power-grid state derived from a benchmark network case, with:
16
+
17
+ - **nodes** representing buses
18
+ - **edges** representing transmission lines
19
+ - **node features** encoding electrical state, bus metadata, and generator properties.
20
+ - **edge features** encoding electrical line parameters.
21
+
22
+ The data is split into two different datasets:
23
+
24
+ - **PF mode (Power Flow)**
25
+ The samples are merely physically (power-flow) consistent with non-cost-optimal generations.
26
+
27
+ - **OPF mode (Optimal Power Flow)**
28
+ The samples are creating using an opf-solver such that generator setpoints are cost-optimal.
29
+
30
+
31
+ ## Available data
32
+
33
+ The processed dataset currently includes the following grid cases and sample counts:
34
+
35
+ | grid | #buses | #gens | #lines | pf samples | opf samples |
36
+ |---|---:|---:|---:|---:|---:|
37
+ | case3_lmbd | 3 | 3 | 6 | 1,224,988 | 934,045 |
38
+ | case5_pjm | 5 | 5 | 12 | 1,287,400 | 1,214,688 |
39
+ | case14_ieee | 14 | 5 | 40 | 1,290,095 | 1,300,186 |
40
+ | case24_ieee_rts | 24 | 33 | 76 | 1,290,126 | 1,301,982 |
41
+ | case30_ieee | 30 | 6 | 82 | 1,300,680 | 1,296,767 |
42
+ | case30_as | 30 | 6 | 82 | 1,300,200 | 1,284,562 |
43
+ | case39_epri | 39 | 10 | 92 | 1,300,211 | 1,301,635 |
44
+ | case57_ieee | 57 | 7 | 160 | 1,301,222 | 1,273,026 |
45
+ | case60_c | 60 | 23 | 176 | 1,302,069 | 1,300,858 |
46
+ | case73_ieee_rts | 73 | 99 | 240 | 1,300,405 | 1,301,531 |
47
+ | case89_pegase | 89 | 12 | 420 | 654,591 | 1,483,225 |
48
+ | case118_ieee | 118 | 54 | 372 | 1,300,742 | 1,301,781 |
49
+ | case162_ieee_dtc | 162 | 12 | 568 | 1,046,318 | 181,038 |
50
+ | case179_goc | 179 | 29 | 526 | 1,293,617 | 739,821 |
51
+ | case197_snem | 197 | 35 | 572 | 1,301,323 | 1,391,101 |
52
+ | case200_activ | 200 | 49 | 490 | 1,301,480 | 1,320,560 |
53
+ | case240_pserc | 240 | 143 | 896 | 1,011,541 | 260,102 |
54
+ | case300_ieee | 300 | 69 | 822 | 1,067,772 | 625,028 |
55
+ | case500_goc | 500 | 224 | 1,466 | 1,018,707 | 543,710 |
56
+ | case588_sdet | 588 | 167 | 1,372 | 1,427,568 | 622,209 |
57
+ | case793_goc | 793 | 214 | 1,826 | 1,414,878 | 405,521 |
58
+
59
+
60
+ ## What the data consists of
61
+
62
+ At a high level, the dataset contains:
63
+
64
+ - benchmark power-grid topologies
65
+ - sampled and perturbed operating conditions
66
+ - simulated physical solutions
67
+ - graph-structured representations for ML
68
+
69
+ ### Node features
70
+
71
+ | # | Feature | Name | PF-PQ | PF-PV | PF-REF | OPF-PQ | OPF-PV | OPF-REF | SE-PQ | SE-PV | SE-REF |
72
+ |---:|---|---|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|
73
+ | 0 | P_d | Active load demand | I | I | I | I | I | I | M | M | M |
74
+ | 1 | Q_d | Reactive load demand | I | I | I | I | I | I | M | M | M |
75
+ | 2 | Q_g | Reactive generation | I | O | O | I | O | O | M | M | M |
76
+ | 3 | V_m | Voltage magnitude | O | I | O | O | O | O | M | M | M |
77
+ | 4 | V_a | Voltage angle | O | O | I | O | O | I | O | O | O |
78
+ | 5 | PQ flag | PQ bus indicator | I | I | I | I | I | I | I | I | I |
79
+ | 6 | PV flag | PV bus indicator | I | I | I | I | I | I | I | I | I |
80
+ | 7 | REF flag | Slack bus indicator | I | I | I | I | I | I | I | I | I |
81
+ | 8 | V_m^min | Min. voltage magnitude | -- | -- | -- | I | I | I | I | I | I |
82
+ | 9 | V_m^max | Max. voltage magnitude | -- | -- | -- | I | I | I | I | I | I |
83
+ | 10 | Q_g^min | Min. reactive generation | -- | -- | -- | I | I | I | I | I | I |
84
+ | 11 | Q_g^max | Max. reactive generation | -- | -- | -- | I | I | I | I | I | I |
85
+ | 12 | G_s | Shunt conductance | -- | -- | -- | I | I | I | I | I | I |
86
+ | 13 | B_s | Shunt susceptance | -- | -- | -- | I | I | I | I | I | I |
87
+ | 14 | V_n (kV) | Nominal voltage | -- | -- | -- | I | I | I | I | I | I |
88
+
89
+ ### Generator features
90
+
91
+ | # | Feature | Name | PF-PQ/PV | PF-REF | OPF | State Est. |
92
+ |---:|---|---|:---:|:---:|:---:|:---:|
93
+ | 0 | P_g | Active generation | I | O | O | M |
94
+ | 1 | P_g^min | Min. active generation | -- | -- | I | I |
95
+ | 2 | P_g^max | Max. active generation | -- | -- | I | I |
96
+ | 3 | c_0 | Cost constant term | -- | -- | I | I |
97
+ | 4 | c_1 | Cost linear coefficient | -- | -- | I | I |
98
+ | 5 | c_2 | Cost quadratic coefficient | -- | -- | I | I |
99
+
100
+ ### Edge features
101
+
102
+ | # | Feature | Name | Power Flow | OPF | State Est. |
103
+ |---:|---|---|:---:|:---:|:---:|
104
+ | 0 | P_e | Active power flow | O | O | M |
105
+ | 1 | Q_e | Reactive power flow | O | O | M |
106
+ | 2 | Y_ff,r | From-from admittance (real) | I | I | I |
107
+ | 3 | Y_ff,i | From-from admittance (imag.) | I | I | I |
108
+ | 4 | Y_ft,r | From-to admittance (real) | I | I | I |
109
+ | 5 | Y_ft,i | From-to admittance (imag.) | I | I | I |
110
+ | 6 | tap | Transformer tap ratio | I | I | I |
111
+ | 7 | theta_min | Min. angle difference | -- | I | I |
112
+ | 8 | theta_max | Max. angle difference | -- | I | I |
113
+ | 9 | rate_A | Thermal rating (MVA) | -- | I | I |
114
+
115
+ - I = input feature
116
+ - O = output / target feature
117
+ - M = measured feature
118
+ - -- = not used
119
+
120
+
121
+ ## Data source
122
+
123
+ The samples have been generated using **Gridfm-datakit** on the [**Future Technologies Partition**](https://www.nhr.kit.edu/userdocs/ftp/) on four intel sapphire rapids nodes.
124
+ The underlying network cases (topologies and initial load and generation profiles) are based on **PGLib** benchmark systems, the perturbation framework is **Gridfm-datakit**.
125
+ The preprocessing from **Gridfm-graphkit** has been adapted to allow for larger dataset sizes.
126
+
127
+ ## Perturbations applied during data generation
128
+
129
+ The data generation process in **gridfm-datakit** applies perturbations to create diverse operating conditions and topologies.
130
+
131
+ The perturbation types include:
132
+
133
+ ### 1. Load perturbations
134
+ Load levels are randomly varied using a global scaling factor and local noise.
135
+
136
+ ### 2. Topology and admittance perturbations
137
+ N-k perturbations are used to randomly cut off buses or edges. We used k=1.
138
+ Further, the resistance and reactance parameters are randomly scaled during the perturbation process.
139
+
140
+ ### 3. Generation perturbations
141
+ The generators are perturbed by changing their cost coefficients. In OPF-mode, the generator setpoints are recalculated with an opf-solver
142
+ after topology and load perturbations have been applied. In PF-mode, an OPF-solver is only used BEFORE the perturbations.
143
+
144
+ ## Preprocessing
145
+
146
+ The raw power-system scenarios are preprocessed into a disk-backed heterogeneous graph format for efficient training and random access.
147
+
148
+ ### Raw inputs
149
+
150
+ The preprocessing pipeline starts from three parquet tables per dataset split:
151
+
152
+ - `bus_data.parquet`
153
+ - `gen_data.parquet`
154
+ - `branch_data.parquet`
155
+
156
+ Each row belongs to a specific `scenario`, and each scenario corresponds to one graph sample.
157
+
158
+ ### Scenario validation and filtering
159
+
160
+ Before graph construction, scenarios are validated for structural consistency.
161
+
162
+ In particular, scenarios are removed if their bus indices are invalid, i.e. if:
163
+
164
+ - bus IDs are duplicated, or
165
+ - bus IDs are not consecutive from `0` to `N-1`
166
+
167
+ This ensures that each scenario can be converted into a well-formed graph with a consistent node indexing scheme.
168
+
169
+ ### Feature extraction
170
+
171
+ The preprocessing selects fixed feature subsets for buses, generators, and branches.
172
+
173
+ #### Bus features
174
+ Bus node features include electrical state, bus type indicators, and operating constraints:
175
+
176
+ - `Pd`, `Qd`
177
+ - `Qg`, `Vm`, `Va`
178
+ - `PQ`, `PV`, `REF` flags
179
+ - `min_vm_pu`, `max_vm_pu`
180
+ - `min_q_mvar`, `max_q_mvar`
181
+ - `GS`, `BS`
182
+ - `vn_kv`
183
+
184
+ #### Generator features
185
+ Generator node features include operating quantities and cost parameters:
186
+
187
+ - `p_mw`
188
+ - `min_p_mw`, `max_p_mw`
189
+ - `cp0_eur`, `cp1_eur_per_mw`, `cp2_eur_per_mw2`
190
+ - `in_service`
191
+
192
+ #### Branch features
193
+ Branch edge features include power-flow quantities, admittance terms, and branch constraints.
194
+
195
+ For each physical branch, the preprocessing creates **two directed edges**:
196
+ - one forward edge (`from_bus -> to_bus`)
197
+ - one reverse edge (`to_bus -> from_bus`)
198
+
199
+ The forward and reverse edges receive direction-specific attributes, e.g.:
200
+ - forward: `pf`, `qf`, `Yff_*`, `Yft_*`
201
+ - reverse: `pt`, `qt`, `Ytt_*`, `Ytf_*`
202
+
203
+ Shared branch attributes include:
204
+ - `tap`
205
+ - `ang_min`, `ang_max`
206
+ - `rate_a`
207
+ - `br_status`
208
+
209
+ ### Bus-level aggregation of generator limits
210
+
211
+ Reactive power limits from generators are aggregated onto buses before graph construction.
212
+
213
+ For each `(scenario, bus)`, the preprocessing sums:
214
+ - `min_q_mvar`
215
+ - `max_q_mvar`
216
+
217
+ across all generators connected to that bus, and merges these totals into the bus feature table.
218
+
219
+ This enriches bus nodes with bus-level reactive capability information.
220
+
221
+ ### Target construction
222
+
223
+ Task labels are derived from subsets of the selected features.
224
+
225
+ - **Bus targets** are taken from the leading subset of bus features
226
+ - **Generator targets** are taken from the leading subset of generator features
227
+ - **Branch targets** are stored separately as edge-level flow quantities
228
+
229
+ The exact interpretation of inputs and outputs depends on the downstream task (e.g. PF, OPF, state estimation, reconstruction).
230
+
231
+ ### Heterogeneous graph construction
232
+
233
+ Each scenario is converted into a `HeteroData` graph with:
234
+
235
+ - **bus nodes**
236
+ - **generator nodes**
237
+ - **bus-to-bus edges** for physical branches
238
+ - **generator-to-bus edges**
239
+ - **bus-to-generator edges**
240
+
241
+ This yields a heterogeneous graph representation that preserves both the electrical network structure and generator attachment structure.
242
+
243
+ ### Storage format
244
+
245
+ Instead of storing one file per scenario, the processed dataset is written into a small number of large NumPy memory-mapped arrays (`memmap`).
246
+
247
+ This avoids metadata overhead on large cluster file systems and enables efficient random access.
248
+
249
+ The processed directory contains arrays such as:
250
+
251
+ - `bus_x.npy`, `bus_y.npy`
252
+ - `gen_x.npy`, `gen_y.npy`
253
+ - `edge_index.npy`, `edge_attr.npy`, `edge_y.npy`
254
+ - `gen_bus_ei.npy`, `bus_gen_ei.npy`
255
+
256
+ along with an `index.pt` file containing per-scenario offsets.
257
+
258
+ Using these offsets, a single scenario can be loaded without materializing the full dataset in memory.
259
+
260
+ ### Runtime loading and normalization
261
+
262
+ When a sample is accessed:
263
+
264
+ 1. the corresponding slices are read from the memmap arrays,
265
+ 2. a PyTorch Geometric `HeteroData` object is reconstructed,
266
+ 3. edge indices are converted into PyG format,
267
+ 4. feature normalization is applied at access time.
268
+
269
+ Normalization is therefore **not baked into the stored arrays**, but applied dynamically during dataset loading.