Datasets:
Add files using upload-large-folder tool
Browse files- .gitattributes +3 -0
- PGLearn-Medium-1888_rte.py +429 -0
- README.md +293 -0
- case.json.gz +3 -0
- config.toml +42 -0
- infeasible/ACOPF/dual.h5.gz +3 -0
- infeasible/ACOPF/meta.h5.gz +3 -0
- infeasible/ACOPF/primal.h5.gz +3 -0
- infeasible/DCOPF/dual.h5.gz +3 -0
- infeasible/DCOPF/meta.h5.gz +3 -0
- infeasible/DCOPF/primal.h5.gz +3 -0
- infeasible/SOCOPF/dual.h5.gz +3 -0
- infeasible/SOCOPF/meta.h5.gz +3 -0
- infeasible/SOCOPF/primal.h5.gz +3 -0
- infeasible/input.h5.gz +3 -0
- test/ACOPF/dual.h5.gz +3 -0
- test/ACOPF/meta.h5.gz +3 -0
- test/ACOPF/primal.h5.gz +3 -0
- test/DCOPF/dual.h5.gz +3 -0
- test/DCOPF/meta.h5.gz +3 -0
- test/DCOPF/primal.h5.gz +3 -0
- test/SOCOPF/dual.h5.gz +3 -0
- test/SOCOPF/meta.h5.gz +3 -0
- test/SOCOPF/primal.h5.gz +3 -0
- test/input.h5.gz +3 -0
- train/ACOPF/dual.h5.gz +3 -0
- train/ACOPF/meta.h5.gz +3 -0
- train/ACOPF/primal.h5.gz +3 -0
- train/DCOPF/dual.h5.gz +3 -0
- train/DCOPF/meta.h5.gz +3 -0
- train/DCOPF/primal.h5.gz +3 -0
- train/SOCOPF/dual/xaa +3 -0
- train/SOCOPF/dual/xab +3 -0
- train/SOCOPF/dual/xac +3 -0
- train/SOCOPF/meta.h5.gz +3 -0
- train/SOCOPF/primal.h5.gz +3 -0
- train/input.h5.gz +3 -0
.gitattributes
CHANGED
@@ -57,3 +57,6 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
57 |
# Video files - compressed
|
58 |
*.mp4 filter=lfs diff=lfs merge=lfs -text
|
59 |
*.webm filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
57 |
# Video files - compressed
|
58 |
*.mp4 filter=lfs diff=lfs merge=lfs -text
|
59 |
*.webm filter=lfs diff=lfs merge=lfs -text
|
60 |
+
train/SOCOPF/dual/xac filter=lfs diff=lfs merge=lfs -text
|
61 |
+
train/SOCOPF/dual/xaa filter=lfs diff=lfs merge=lfs -text
|
62 |
+
train/SOCOPF/dual/xab filter=lfs diff=lfs merge=lfs -text
|
PGLearn-Medium-1888_rte.py
ADDED
@@ -0,0 +1,429 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from __future__ import annotations
|
2 |
+
from dataclasses import dataclass
|
3 |
+
from pathlib import Path
|
4 |
+
import json
|
5 |
+
import shutil
|
6 |
+
|
7 |
+
import datasets as hfd
|
8 |
+
import h5py
|
9 |
+
import pgzip as gzip
|
10 |
+
import pyarrow as pa
|
11 |
+
|
12 |
+
# ┌──────────────┐
|
13 |
+
# │ Metadata │
|
14 |
+
# └──────────────┘
|
15 |
+
|
16 |
+
@dataclass
|
17 |
+
class CaseSizes:
|
18 |
+
n_bus: int
|
19 |
+
n_load: int
|
20 |
+
n_gen: int
|
21 |
+
n_branch: int
|
22 |
+
|
23 |
+
CASENAME = "1888_rte"
|
24 |
+
SIZES = CaseSizes(n_bus=1888, n_load=1000, n_gen=290, n_branch=2531)
|
25 |
+
NUM_TRAIN = 371587
|
26 |
+
NUM_TEST = 92897
|
27 |
+
NUM_INFEASIBLE = 35516
|
28 |
+
SPLITFILES = {
|
29 |
+
"train/SOCOPF/dual.h5.gz": ["train/SOCOPF/dual/xaa", "train/SOCOPF/dual/xab", "train/SOCOPF/dual/xac"],
|
30 |
+
}
|
31 |
+
|
32 |
+
URL = "https://huggingface.co/datasets/PGLearn/PGLearn-Medium-1888_rte"
|
33 |
+
DESCRIPTION = """\
|
34 |
+
The 1888_rte PGLearn optimal power flow dataset, part of the PGLearn-Medium collection. \
|
35 |
+
"""
|
36 |
+
VERSION = hfd.Version("1.0.0")
|
37 |
+
DEFAULT_CONFIG_DESCRIPTION="""\
|
38 |
+
This configuration contains feasible input, primal solution, and dual solution data \
|
39 |
+
for the ACOPF, DCOPF, and SOCOPF formulations on the {case} system. For case data, \
|
40 |
+
download the case.json.gz file from the `script` branch of the repository. \
|
41 |
+
https://huggingface.co/datasets/PGLearn/PGLearn-Medium-1888_rte/blob/script/case.json.gz
|
42 |
+
"""
|
43 |
+
USE_ML4OPF_WARNING = """
|
44 |
+
================================================================================================
|
45 |
+
Loading PGLearn-Medium-1888_rte through the `datasets.load_dataset` function may be slow.
|
46 |
+
|
47 |
+
Consider using ML4OPF to directly convert to `torch.Tensor`; for more info see:
|
48 |
+
https://github.com/AI4OPT/ML4OPF?tab=readme-ov-file#manually-loading-data
|
49 |
+
|
50 |
+
Or, use `huggingface_hub.snapshot_download` and an HDF5 reader; for more info see:
|
51 |
+
https://huggingface.co/datasets/PGLearn/PGLearn-Medium-1888_rte#downloading-individual-files
|
52 |
+
================================================================================================
|
53 |
+
"""
|
54 |
+
CITATION = """\
|
55 |
+
@article{klamkinpglearn,
|
56 |
+
title={{PGLearn - An Open-Source Learning Toolkit for Optimal Power Flow}},
|
57 |
+
author={Klamkin, Michael and Tanneau, Mathieu and Van Hentenryck, Pascal},
|
58 |
+
year={2025},
|
59 |
+
}\
|
60 |
+
"""
|
61 |
+
|
62 |
+
IS_COMPRESSED = True
|
63 |
+
|
64 |
+
# ┌──────────────────┐
|
65 |
+
# │ Formulations │
|
66 |
+
# └──────────────────┘
|
67 |
+
|
68 |
+
def acopf_features(sizes: CaseSizes, primal: bool, dual: bool, meta: bool):
|
69 |
+
features = {}
|
70 |
+
if primal: features.update(acopf_primal_features(sizes))
|
71 |
+
if dual: features.update(acopf_dual_features(sizes))
|
72 |
+
if meta: features.update({f"ACOPF/{k}": v for k, v in META_FEATURES.items()})
|
73 |
+
return features
|
74 |
+
|
75 |
+
def dcopf_features(sizes: CaseSizes, primal: bool, dual: bool, meta: bool):
|
76 |
+
features = {}
|
77 |
+
if primal: features.update(dcopf_primal_features(sizes))
|
78 |
+
if dual: features.update(dcopf_dual_features(sizes))
|
79 |
+
if meta: features.update({f"DCOPF/{k}": v for k, v in META_FEATURES.items()})
|
80 |
+
return features
|
81 |
+
|
82 |
+
def socopf_features(sizes: CaseSizes, primal: bool, dual: bool, meta: bool):
|
83 |
+
features = {}
|
84 |
+
if primal: features.update(socopf_primal_features(sizes))
|
85 |
+
if dual: features.update(socopf_dual_features(sizes))
|
86 |
+
if meta: features.update({f"SOCOPF/{k}": v for k, v in META_FEATURES.items()})
|
87 |
+
return features
|
88 |
+
|
89 |
+
FORMULATIONS_TO_FEATURES = {
|
90 |
+
"ACOPF": acopf_features,
|
91 |
+
"DCOPF": dcopf_features,
|
92 |
+
"SOCOPF": socopf_features,
|
93 |
+
}
|
94 |
+
|
95 |
+
# ┌───────────────────┐
|
96 |
+
# │ BuilderConfig │
|
97 |
+
# └───────────────────┘
|
98 |
+
|
99 |
+
class PGLearnMedium1888_rteConfig(hfd.BuilderConfig):
|
100 |
+
"""BuilderConfig for PGLearn-Medium-1888_rte.
|
101 |
+
By default, primal solution data, metadata, input, casejson, are included for the train and test splits.
|
102 |
+
|
103 |
+
To modify the default configuration, pass attributes of this class to `datasets.load_dataset`:
|
104 |
+
|
105 |
+
Attributes:
|
106 |
+
formulations (list[str]): The formulation(s) to include, e.g. ["ACOPF", "DCOPF"]
|
107 |
+
primal (bool, optional): Include primal solution data. Defaults to True.
|
108 |
+
dual (bool, optional): Include dual solution data. Defaults to False.
|
109 |
+
meta (bool, optional): Include metadata. Defaults to True.
|
110 |
+
input (bool, optional): Include input data. Defaults to True.
|
111 |
+
casejson (bool, optional): Include case.json data. Defaults to True.
|
112 |
+
train (bool, optional): Include training samples. Defaults to True.
|
113 |
+
test (bool, optional): Include testing samples. Defaults to True.
|
114 |
+
infeasible (bool, optional): Include infeasible samples. Defaults to False.
|
115 |
+
"""
|
116 |
+
def __init__(self,
|
117 |
+
formulations: list[str],
|
118 |
+
primal: bool=True, dual: bool=False, meta: bool=True, input: bool = True, casejson: bool=True,
|
119 |
+
train: bool=True, test: bool=True, infeasible: bool=False,
|
120 |
+
compressed: bool=IS_COMPRESSED, **kwargs
|
121 |
+
):
|
122 |
+
super(PGLearnMedium1888_rteConfig, self).__init__(version=VERSION, **kwargs)
|
123 |
+
|
124 |
+
self.case = CASENAME
|
125 |
+
self.formulations = formulations
|
126 |
+
|
127 |
+
self.primal = primal
|
128 |
+
self.dual = dual
|
129 |
+
self.meta = meta
|
130 |
+
self.input = input
|
131 |
+
self.casejson = casejson
|
132 |
+
|
133 |
+
self.train = train
|
134 |
+
self.test = test
|
135 |
+
self.infeasible = infeasible
|
136 |
+
|
137 |
+
self.gz_ext = ".gz" if compressed else ""
|
138 |
+
|
139 |
+
@property
|
140 |
+
def size(self):
|
141 |
+
return SIZES
|
142 |
+
|
143 |
+
@property
|
144 |
+
def features(self):
|
145 |
+
features = {}
|
146 |
+
if self.casejson: features.update(case_features())
|
147 |
+
if self.input: features.update(input_features(SIZES))
|
148 |
+
for formulation in self.formulations:
|
149 |
+
features.update(FORMULATIONS_TO_FEATURES[formulation](SIZES, self.primal, self.dual, self.meta))
|
150 |
+
return hfd.Features(features)
|
151 |
+
|
152 |
+
@property
|
153 |
+
def splits(self):
|
154 |
+
splits: dict[hfd.Split, dict[str, str | int]] = {}
|
155 |
+
if self.train:
|
156 |
+
splits[hfd.Split.TRAIN] = {
|
157 |
+
"name": "train",
|
158 |
+
"num_examples": NUM_TRAIN
|
159 |
+
}
|
160 |
+
if self.test:
|
161 |
+
splits[hfd.Split.TEST] = {
|
162 |
+
"name": "test",
|
163 |
+
"num_examples": NUM_TEST
|
164 |
+
}
|
165 |
+
if self.infeasible:
|
166 |
+
splits[hfd.Split("infeasible")] = {
|
167 |
+
"name": "infeasible",
|
168 |
+
"num_examples": NUM_INFEASIBLE
|
169 |
+
}
|
170 |
+
return splits
|
171 |
+
|
172 |
+
@property
|
173 |
+
def urls(self):
|
174 |
+
urls: dict[str, None | str | list] = {
|
175 |
+
"case": None, "train": [], "test": [], "infeasible": [],
|
176 |
+
}
|
177 |
+
|
178 |
+
if self.casejson:
|
179 |
+
urls["case"] = f"case.json" + self.gz_ext
|
180 |
+
else:
|
181 |
+
urls.pop("case")
|
182 |
+
|
183 |
+
split_names = []
|
184 |
+
if self.train: split_names.append("train")
|
185 |
+
if self.test: split_names.append("test")
|
186 |
+
if self.infeasible: split_names.append("infeasible")
|
187 |
+
|
188 |
+
for split in split_names:
|
189 |
+
if self.input: urls[split].append(f"{split}/input.h5" + self.gz_ext)
|
190 |
+
for formulation in self.formulations:
|
191 |
+
if self.primal:
|
192 |
+
filename = f"{split}/{formulation}/primal.h5" + self.gz_ext
|
193 |
+
if filename in SPLITFILES: urls[split].append(SPLITFILES[filename])
|
194 |
+
else: urls[split].append(filename)
|
195 |
+
if self.dual:
|
196 |
+
filename = f"{split}/{formulation}/dual.h5" + self.gz_ext
|
197 |
+
if filename in SPLITFILES: urls[split].append(SPLITFILES[filename])
|
198 |
+
else: urls[split].append(filename)
|
199 |
+
if self.meta:
|
200 |
+
filename = f"{split}/{formulation}/meta.h5" + self.gz_ext
|
201 |
+
if filename in SPLITFILES: urls[split].append(SPLITFILES[filename])
|
202 |
+
else: urls[split].append(filename)
|
203 |
+
return urls
|
204 |
+
|
205 |
+
# ┌────────────────────┐
|
206 |
+
# │ DatasetBuilder │
|
207 |
+
# └────────────────────┘
|
208 |
+
|
209 |
+
class PGLearnMedium1888_rte(hfd.ArrowBasedBuilder):
|
210 |
+
"""DatasetBuilder for PGLearn-Medium-1888_rte.
|
211 |
+
The main interface is `datasets.load_dataset` with `trust_remote_code=True`, e.g.
|
212 |
+
|
213 |
+
```python
|
214 |
+
from datasets import load_dataset
|
215 |
+
ds = load_dataset("PGLearn/PGLearn-Medium-1888_rte", trust_remote_code=True,
|
216 |
+
# modify the default configuration by passing kwargs
|
217 |
+
formulations=["DCOPF"],
|
218 |
+
dual=False,
|
219 |
+
meta=False,
|
220 |
+
)
|
221 |
+
```
|
222 |
+
"""
|
223 |
+
|
224 |
+
DEFAULT_WRITER_BATCH_SIZE = 10000
|
225 |
+
BUILDER_CONFIG_CLASS = PGLearnMedium1888_rteConfig
|
226 |
+
DEFAULT_CONFIG_NAME=CASENAME
|
227 |
+
BUILDER_CONFIGS = [
|
228 |
+
PGLearnMedium1888_rteConfig(
|
229 |
+
name=CASENAME, description=DEFAULT_CONFIG_DESCRIPTION.format(case=CASENAME),
|
230 |
+
formulations=list(FORMULATIONS_TO_FEATURES.keys()),
|
231 |
+
primal=True, dual=True, meta=True, input=True, casejson=False,
|
232 |
+
train=True, test=True, infeasible=False,
|
233 |
+
)
|
234 |
+
]
|
235 |
+
|
236 |
+
def _info(self):
|
237 |
+
return hfd.DatasetInfo(
|
238 |
+
features=self.config.features, splits=self.config.splits,
|
239 |
+
description=DESCRIPTION + self.config.description,
|
240 |
+
homepage=URL, citation=CITATION,
|
241 |
+
)
|
242 |
+
|
243 |
+
def _split_generators(self, dl_manager: hfd.DownloadManager):
|
244 |
+
hfd.logging.get_logger().warning(USE_ML4OPF_WARNING)
|
245 |
+
|
246 |
+
filepaths = dl_manager.download_and_extract(self.config.urls)
|
247 |
+
|
248 |
+
splits: list[hfd.SplitGenerator] = []
|
249 |
+
if self.config.train:
|
250 |
+
splits.append(hfd.SplitGenerator(
|
251 |
+
name=hfd.Split.TRAIN,
|
252 |
+
gen_kwargs=dict(case_file=filepaths.get("case", None), data_files=tuple(filepaths["train"]), n_samples=NUM_TRAIN),
|
253 |
+
))
|
254 |
+
if self.config.test:
|
255 |
+
splits.append(hfd.SplitGenerator(
|
256 |
+
name=hfd.Split.TEST,
|
257 |
+
gen_kwargs=dict(case_file=filepaths.get("case", None), data_files=tuple(filepaths["test"]), n_samples=NUM_TEST),
|
258 |
+
))
|
259 |
+
if self.config.infeasible:
|
260 |
+
splits.append(hfd.SplitGenerator(
|
261 |
+
name=hfd.Split("infeasible"),
|
262 |
+
gen_kwargs=dict(case_file=filepaths.get("case", None), data_files=tuple(filepaths["infeasible"]), n_samples=NUM_INFEASIBLE),
|
263 |
+
))
|
264 |
+
return splits
|
265 |
+
|
266 |
+
def _generate_tables(self, case_file: str | None, data_files: tuple[hfd.utils.track.tracked_str | list[hfd.utils.track.tracked_str]], n_samples: int):
|
267 |
+
case_data: str | None = json.dumps(json.load(open_maybe_gzip_cat(case_file))) if case_file is not None else None
|
268 |
+
data: dict[str, h5py.File] = {}
|
269 |
+
for file in data_files:
|
270 |
+
v = h5py.File(open_maybe_gzip_cat(file), "r")
|
271 |
+
if isinstance(file, list):
|
272 |
+
k = "/".join(Path(file[0].get_origin()).parts[-3:-1]).split(".")[0]
|
273 |
+
else:
|
274 |
+
k = "/".join(Path(file.get_origin()).parts[-2:]).split(".")[0]
|
275 |
+
data[k] = v
|
276 |
+
for k in list(data.keys()):
|
277 |
+
if "/input" in k: data[k.split("/", 1)[1]] = data.pop(k)
|
278 |
+
|
279 |
+
batch_size = self._writer_batch_size or self.DEFAULT_WRITER_BATCH_SIZE
|
280 |
+
for i in range(0, n_samples, batch_size):
|
281 |
+
effective_batch_size = min(batch_size, n_samples - i)
|
282 |
+
|
283 |
+
sample_data = {
|
284 |
+
f"{dk}/{k}":
|
285 |
+
hfd.features.features.numpy_to_pyarrow_listarray(v[i:i + effective_batch_size, ...])
|
286 |
+
for dk, d in data.items() for k, v in d.items() if f"{dk}/{k}" in self.config.features
|
287 |
+
}
|
288 |
+
|
289 |
+
if case_data is not None:
|
290 |
+
sample_data["case/json"] = pa.array([case_data] * effective_batch_size)
|
291 |
+
|
292 |
+
yield i, pa.Table.from_pydict(sample_data)
|
293 |
+
|
294 |
+
for f in data.values():
|
295 |
+
f.close()
|
296 |
+
|
297 |
+
# ┌──────────────┐
|
298 |
+
# │ Features │
|
299 |
+
# └──────────────┘
|
300 |
+
|
301 |
+
FLOAT_TYPE = "float32"
|
302 |
+
INT_TYPE = "int64"
|
303 |
+
BOOL_TYPE = "bool"
|
304 |
+
STRING_TYPE = "string"
|
305 |
+
|
306 |
+
def case_features():
|
307 |
+
# FIXME: better way to share schema of case data -- need to treat jagged arrays
|
308 |
+
return {
|
309 |
+
"case/json": hfd.Value(STRING_TYPE),
|
310 |
+
}
|
311 |
+
|
312 |
+
META_FEATURES = {
|
313 |
+
"meta/seed": hfd.Value(dtype=INT_TYPE),
|
314 |
+
"meta/formulation": hfd.Value(dtype=STRING_TYPE),
|
315 |
+
"meta/primal_objective_value": hfd.Value(dtype=FLOAT_TYPE),
|
316 |
+
"meta/dual_objective_value": hfd.Value(dtype=FLOAT_TYPE),
|
317 |
+
"meta/primal_status": hfd.Value(dtype=STRING_TYPE),
|
318 |
+
"meta/dual_status": hfd.Value(dtype=STRING_TYPE),
|
319 |
+
"meta/termination_status": hfd.Value(dtype=STRING_TYPE),
|
320 |
+
"meta/build_time": hfd.Value(dtype=FLOAT_TYPE),
|
321 |
+
"meta/extract_time": hfd.Value(dtype=FLOAT_TYPE),
|
322 |
+
"meta/solve_time": hfd.Value(dtype=FLOAT_TYPE),
|
323 |
+
}
|
324 |
+
|
325 |
+
def input_features(sizes: CaseSizes):
|
326 |
+
return {
|
327 |
+
"input/pd": hfd.Sequence(length=sizes.n_load, feature=hfd.Value(dtype=FLOAT_TYPE)),
|
328 |
+
"input/qd": hfd.Sequence(length=sizes.n_load, feature=hfd.Value(dtype=FLOAT_TYPE)),
|
329 |
+
"input/gen_status": hfd.Sequence(length=sizes.n_gen, feature=hfd.Value(dtype=BOOL_TYPE)),
|
330 |
+
"input/branch_status": hfd.Sequence(length=sizes.n_branch, feature=hfd.Value(dtype=BOOL_TYPE)),
|
331 |
+
"input/seed": hfd.Value(dtype=INT_TYPE),
|
332 |
+
}
|
333 |
+
|
334 |
+
def acopf_primal_features(sizes: CaseSizes):
|
335 |
+
return {
|
336 |
+
"ACOPF/primal/vm": hfd.Sequence(length=sizes.n_bus, feature=hfd.Value(dtype=FLOAT_TYPE)),
|
337 |
+
"ACOPF/primal/va": hfd.Sequence(length=sizes.n_bus, feature=hfd.Value(dtype=FLOAT_TYPE)),
|
338 |
+
"ACOPF/primal/pg": hfd.Sequence(length=sizes.n_gen, feature=hfd.Value(dtype=FLOAT_TYPE)),
|
339 |
+
"ACOPF/primal/qg": hfd.Sequence(length=sizes.n_gen, feature=hfd.Value(dtype=FLOAT_TYPE)),
|
340 |
+
"ACOPF/primal/pf": hfd.Sequence(length=sizes.n_branch, feature=hfd.Value(dtype=FLOAT_TYPE)),
|
341 |
+
"ACOPF/primal/pt": hfd.Sequence(length=sizes.n_branch, feature=hfd.Value(dtype=FLOAT_TYPE)),
|
342 |
+
"ACOPF/primal/qf": hfd.Sequence(length=sizes.n_branch, feature=hfd.Value(dtype=FLOAT_TYPE)),
|
343 |
+
"ACOPF/primal/qt": hfd.Sequence(length=sizes.n_branch, feature=hfd.Value(dtype=FLOAT_TYPE)),
|
344 |
+
}
|
345 |
+
def acopf_dual_features(sizes: CaseSizes):
|
346 |
+
return {
|
347 |
+
"ACOPF/dual/kcl_p": hfd.Sequence(length=sizes.n_bus, feature=hfd.Value(dtype=FLOAT_TYPE)),
|
348 |
+
"ACOPF/dual/kcl_q": hfd.Sequence(length=sizes.n_bus, feature=hfd.Value(dtype=FLOAT_TYPE)),
|
349 |
+
"ACOPF/dual/vm": hfd.Sequence(length=sizes.n_bus, feature=hfd.Value(dtype=FLOAT_TYPE)),
|
350 |
+
"ACOPF/dual/pg": hfd.Sequence(length=sizes.n_gen, feature=hfd.Value(dtype=FLOAT_TYPE)),
|
351 |
+
"ACOPF/dual/qg": hfd.Sequence(length=sizes.n_gen, feature=hfd.Value(dtype=FLOAT_TYPE)),
|
352 |
+
"ACOPF/dual/ohm_pf": hfd.Sequence(length=sizes.n_branch, feature=hfd.Value(dtype=FLOAT_TYPE)),
|
353 |
+
"ACOPF/dual/ohm_pt": hfd.Sequence(length=sizes.n_branch, feature=hfd.Value(dtype=FLOAT_TYPE)),
|
354 |
+
"ACOPF/dual/ohm_qf": hfd.Sequence(length=sizes.n_branch, feature=hfd.Value(dtype=FLOAT_TYPE)),
|
355 |
+
"ACOPF/dual/ohm_qt": hfd.Sequence(length=sizes.n_branch, feature=hfd.Value(dtype=FLOAT_TYPE)),
|
356 |
+
"ACOPF/dual/pf": hfd.Sequence(length=sizes.n_branch, feature=hfd.Value(dtype=FLOAT_TYPE)),
|
357 |
+
"ACOPF/dual/pt": hfd.Sequence(length=sizes.n_branch, feature=hfd.Value(dtype=FLOAT_TYPE)),
|
358 |
+
"ACOPF/dual/qf": hfd.Sequence(length=sizes.n_branch, feature=hfd.Value(dtype=FLOAT_TYPE)),
|
359 |
+
"ACOPF/dual/qt": hfd.Sequence(length=sizes.n_branch, feature=hfd.Value(dtype=FLOAT_TYPE)),
|
360 |
+
"ACOPF/dual/va_diff": hfd.Sequence(length=sizes.n_branch, feature=hfd.Value(dtype=FLOAT_TYPE)),
|
361 |
+
"ACOPF/dual/sm_fr": hfd.Sequence(length=sizes.n_branch, feature=hfd.Value(dtype=FLOAT_TYPE)),
|
362 |
+
"ACOPF/dual/sm_to": hfd.Sequence(length=sizes.n_branch, feature=hfd.Value(dtype=FLOAT_TYPE)),
|
363 |
+
"ACOPF/dual/slack_bus": hfd.Value(dtype=FLOAT_TYPE),
|
364 |
+
}
|
365 |
+
def dcopf_primal_features(sizes: CaseSizes):
|
366 |
+
return {
|
367 |
+
"DCOPF/primal/va": hfd.Sequence(length=sizes.n_bus, feature=hfd.Value(dtype=FLOAT_TYPE)),
|
368 |
+
"DCOPF/primal/pg": hfd.Sequence(length=sizes.n_gen, feature=hfd.Value(dtype=FLOAT_TYPE)),
|
369 |
+
"DCOPF/primal/pf": hfd.Sequence(length=sizes.n_branch, feature=hfd.Value(dtype=FLOAT_TYPE)),
|
370 |
+
}
|
371 |
+
def dcopf_dual_features(sizes: CaseSizes):
|
372 |
+
return {
|
373 |
+
"DCOPF/dual/kcl_p": hfd.Sequence(length=sizes.n_bus, feature=hfd.Value(dtype=FLOAT_TYPE)),
|
374 |
+
"DCOPF/dual/pg": hfd.Sequence(length=sizes.n_gen, feature=hfd.Value(dtype=FLOAT_TYPE)),
|
375 |
+
"DCOPF/dual/ohm_pf": hfd.Sequence(length=sizes.n_branch, feature=hfd.Value(dtype=FLOAT_TYPE)),
|
376 |
+
"DCOPF/dual/pf": hfd.Sequence(length=sizes.n_branch, feature=hfd.Value(dtype=FLOAT_TYPE)),
|
377 |
+
"DCOPF/dual/va_diff": hfd.Sequence(length=sizes.n_branch, feature=hfd.Value(dtype=FLOAT_TYPE)),
|
378 |
+
"DCOPF/dual/slack_bus": hfd.Value(dtype=FLOAT_TYPE),
|
379 |
+
}
|
380 |
+
def socopf_primal_features(sizes: CaseSizes):
|
381 |
+
return {
|
382 |
+
"SOCOPF/primal/w": hfd.Sequence(length=sizes.n_bus, feature=hfd.Value(dtype=FLOAT_TYPE)),
|
383 |
+
"SOCOPF/primal/pg": hfd.Sequence(length=sizes.n_gen, feature=hfd.Value(dtype=FLOAT_TYPE)),
|
384 |
+
"SOCOPF/primal/qg": hfd.Sequence(length=sizes.n_gen, feature=hfd.Value(dtype=FLOAT_TYPE)),
|
385 |
+
"SOCOPF/primal/pf": hfd.Sequence(length=sizes.n_branch, feature=hfd.Value(dtype=FLOAT_TYPE)),
|
386 |
+
"SOCOPF/primal/pt": hfd.Sequence(length=sizes.n_branch, feature=hfd.Value(dtype=FLOAT_TYPE)),
|
387 |
+
"SOCOPF/primal/qf": hfd.Sequence(length=sizes.n_branch, feature=hfd.Value(dtype=FLOAT_TYPE)),
|
388 |
+
"SOCOPF/primal/qt": hfd.Sequence(length=sizes.n_branch, feature=hfd.Value(dtype=FLOAT_TYPE)),
|
389 |
+
"SOCOPF/primal/wr": hfd.Sequence(length=sizes.n_branch, feature=hfd.Value(dtype=FLOAT_TYPE)),
|
390 |
+
"SOCOPF/primal/wi": hfd.Sequence(length=sizes.n_branch, feature=hfd.Value(dtype=FLOAT_TYPE)),
|
391 |
+
}
|
392 |
+
def socopf_dual_features(sizes: CaseSizes):
|
393 |
+
return {
|
394 |
+
"SOCOPF/dual/kcl_p": hfd.Sequence(length=sizes.n_bus, feature=hfd.Value(dtype=FLOAT_TYPE)),
|
395 |
+
"SOCOPF/dual/kcl_q": hfd.Sequence(length=sizes.n_bus, feature=hfd.Value(dtype=FLOAT_TYPE)),
|
396 |
+
"SOCOPF/dual/w": hfd.Sequence(length=sizes.n_bus, feature=hfd.Value(dtype=FLOAT_TYPE)),
|
397 |
+
"SOCOPF/dual/pg": hfd.Sequence(length=sizes.n_gen, feature=hfd.Value(dtype=FLOAT_TYPE)),
|
398 |
+
"SOCOPF/dual/qg": hfd.Sequence(length=sizes.n_gen, feature=hfd.Value(dtype=FLOAT_TYPE)),
|
399 |
+
"SOCOPF/dual/ohm_pf": hfd.Sequence(length=sizes.n_branch, feature=hfd.Value(dtype=FLOAT_TYPE)),
|
400 |
+
"SOCOPF/dual/ohm_pt": hfd.Sequence(length=sizes.n_branch, feature=hfd.Value(dtype=FLOAT_TYPE)),
|
401 |
+
"SOCOPF/dual/ohm_qf": hfd.Sequence(length=sizes.n_branch, feature=hfd.Value(dtype=FLOAT_TYPE)),
|
402 |
+
"SOCOPF/dual/ohm_qt": hfd.Sequence(length=sizes.n_branch, feature=hfd.Value(dtype=FLOAT_TYPE)),
|
403 |
+
"SOCOPF/dual/jabr": hfd.Array2D(shape=(sizes.n_branch, 4), dtype=FLOAT_TYPE),
|
404 |
+
"SOCOPF/dual/sm_fr": hfd.Array2D(shape=(sizes.n_branch, 3), dtype=FLOAT_TYPE),
|
405 |
+
"SOCOPF/dual/sm_to": hfd.Array2D(shape=(sizes.n_branch, 3), dtype=FLOAT_TYPE),
|
406 |
+
"SOCOPF/dual/va_diff": hfd.Sequence(length=sizes.n_branch, feature=hfd.Value(dtype=FLOAT_TYPE)),
|
407 |
+
"SOCOPF/dual/wr": hfd.Sequence(length=sizes.n_branch, feature=hfd.Value(dtype=FLOAT_TYPE)),
|
408 |
+
"SOCOPF/dual/wi": hfd.Sequence(length=sizes.n_branch, feature=hfd.Value(dtype=FLOAT_TYPE)),
|
409 |
+
"SOCOPF/dual/pf": hfd.Sequence(length=sizes.n_branch, feature=hfd.Value(dtype=FLOAT_TYPE)),
|
410 |
+
"SOCOPF/dual/pt": hfd.Sequence(length=sizes.n_branch, feature=hfd.Value(dtype=FLOAT_TYPE)),
|
411 |
+
"SOCOPF/dual/qf": hfd.Sequence(length=sizes.n_branch, feature=hfd.Value(dtype=FLOAT_TYPE)),
|
412 |
+
"SOCOPF/dual/qt": hfd.Sequence(length=sizes.n_branch, feature=hfd.Value(dtype=FLOAT_TYPE)),
|
413 |
+
}
|
414 |
+
|
415 |
+
# ┌───────────────┐
|
416 |
+
# │ Utilities │
|
417 |
+
# └───────────────┘
|
418 |
+
|
419 |
+
def open_maybe_gzip_cat(path: str | list):
|
420 |
+
if isinstance(path, list):
|
421 |
+
dest = Path(path[0]).parent.with_suffix(".h5")
|
422 |
+
if not dest.exists():
|
423 |
+
with open(dest, "wb") as dest_f:
|
424 |
+
for piece in path:
|
425 |
+
with open(piece, "rb") as piece_f:
|
426 |
+
shutil.copyfileobj(piece_f, dest_f)
|
427 |
+
shutil.rmtree(Path(piece).parent)
|
428 |
+
path = dest.as_posix()
|
429 |
+
return gzip.open(path, "rb") if path.endswith(".gz") else open(path, "rb")
|
README.md
ADDED
@@ -0,0 +1,293 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: cc-by-sa-4.0
|
3 |
+
tags:
|
4 |
+
- energy
|
5 |
+
- optimization
|
6 |
+
- optimal_power_flow
|
7 |
+
- power_grid
|
8 |
+
pretty_name: PGLearn Optimal Power Flow (1888_rte)
|
9 |
+
task_categories:
|
10 |
+
- tabular-regression
|
11 |
+
dataset_info:
|
12 |
+
config_name: 1888_rte
|
13 |
+
features:
|
14 |
+
- name: input/pd
|
15 |
+
sequence: float32
|
16 |
+
length: 1000
|
17 |
+
- name: input/qd
|
18 |
+
sequence: float32
|
19 |
+
length: 1000
|
20 |
+
- name: input/gen_status
|
21 |
+
sequence: bool
|
22 |
+
length: 290
|
23 |
+
- name: input/branch_status
|
24 |
+
sequence: bool
|
25 |
+
length: 2531
|
26 |
+
- name: input/seed
|
27 |
+
dtype: int64
|
28 |
+
- name: ACOPF/primal/vm
|
29 |
+
sequence: float32
|
30 |
+
length: 1888
|
31 |
+
- name: ACOPF/primal/va
|
32 |
+
sequence: float32
|
33 |
+
length: 1888
|
34 |
+
- name: ACOPF/primal/pg
|
35 |
+
sequence: float32
|
36 |
+
length: 290
|
37 |
+
- name: ACOPF/primal/qg
|
38 |
+
sequence: float32
|
39 |
+
length: 290
|
40 |
+
- name: ACOPF/primal/pf
|
41 |
+
sequence: float32
|
42 |
+
length: 2531
|
43 |
+
- name: ACOPF/primal/pt
|
44 |
+
sequence: float32
|
45 |
+
length: 2531
|
46 |
+
- name: ACOPF/primal/qf
|
47 |
+
sequence: float32
|
48 |
+
length: 2531
|
49 |
+
- name: ACOPF/primal/qt
|
50 |
+
sequence: float32
|
51 |
+
length: 2531
|
52 |
+
- name: ACOPF/dual/kcl_p
|
53 |
+
sequence: float32
|
54 |
+
length: 1888
|
55 |
+
- name: ACOPF/dual/kcl_q
|
56 |
+
sequence: float32
|
57 |
+
length: 1888
|
58 |
+
- name: ACOPF/dual/vm
|
59 |
+
sequence: float32
|
60 |
+
length: 1888
|
61 |
+
- name: ACOPF/dual/pg
|
62 |
+
sequence: float32
|
63 |
+
length: 290
|
64 |
+
- name: ACOPF/dual/qg
|
65 |
+
sequence: float32
|
66 |
+
length: 290
|
67 |
+
- name: ACOPF/dual/ohm_pf
|
68 |
+
sequence: float32
|
69 |
+
length: 2531
|
70 |
+
- name: ACOPF/dual/ohm_pt
|
71 |
+
sequence: float32
|
72 |
+
length: 2531
|
73 |
+
- name: ACOPF/dual/ohm_qf
|
74 |
+
sequence: float32
|
75 |
+
length: 2531
|
76 |
+
- name: ACOPF/dual/ohm_qt
|
77 |
+
sequence: float32
|
78 |
+
length: 2531
|
79 |
+
- name: ACOPF/dual/pf
|
80 |
+
sequence: float32
|
81 |
+
length: 2531
|
82 |
+
- name: ACOPF/dual/pt
|
83 |
+
sequence: float32
|
84 |
+
length: 2531
|
85 |
+
- name: ACOPF/dual/qf
|
86 |
+
sequence: float32
|
87 |
+
length: 2531
|
88 |
+
- name: ACOPF/dual/qt
|
89 |
+
sequence: float32
|
90 |
+
length: 2531
|
91 |
+
- name: ACOPF/dual/va_diff
|
92 |
+
sequence: float32
|
93 |
+
length: 2531
|
94 |
+
- name: ACOPF/dual/sm_fr
|
95 |
+
sequence: float32
|
96 |
+
length: 2531
|
97 |
+
- name: ACOPF/dual/sm_to
|
98 |
+
sequence: float32
|
99 |
+
length: 2531
|
100 |
+
- name: ACOPF/dual/slack_bus
|
101 |
+
dtype: float32
|
102 |
+
- name: ACOPF/meta/seed
|
103 |
+
dtype: int64
|
104 |
+
- name: ACOPF/meta/formulation
|
105 |
+
dtype: string
|
106 |
+
- name: ACOPF/meta/primal_objective_value
|
107 |
+
dtype: float32
|
108 |
+
- name: ACOPF/meta/dual_objective_value
|
109 |
+
dtype: float32
|
110 |
+
- name: ACOPF/meta/primal_status
|
111 |
+
dtype: string
|
112 |
+
- name: ACOPF/meta/dual_status
|
113 |
+
dtype: string
|
114 |
+
- name: ACOPF/meta/termination_status
|
115 |
+
dtype: string
|
116 |
+
- name: ACOPF/meta/build_time
|
117 |
+
dtype: float32
|
118 |
+
- name: ACOPF/meta/extract_time
|
119 |
+
dtype: float32
|
120 |
+
- name: ACOPF/meta/solve_time
|
121 |
+
dtype: float32
|
122 |
+
- name: DCOPF/primal/va
|
123 |
+
sequence: float32
|
124 |
+
length: 1888
|
125 |
+
- name: DCOPF/primal/pg
|
126 |
+
sequence: float32
|
127 |
+
length: 290
|
128 |
+
- name: DCOPF/primal/pf
|
129 |
+
sequence: float32
|
130 |
+
length: 2531
|
131 |
+
- name: DCOPF/dual/kcl_p
|
132 |
+
sequence: float32
|
133 |
+
length: 1888
|
134 |
+
- name: DCOPF/dual/pg
|
135 |
+
sequence: float32
|
136 |
+
length: 290
|
137 |
+
- name: DCOPF/dual/ohm_pf
|
138 |
+
sequence: float32
|
139 |
+
length: 2531
|
140 |
+
- name: DCOPF/dual/pf
|
141 |
+
sequence: float32
|
142 |
+
length: 2531
|
143 |
+
- name: DCOPF/dual/va_diff
|
144 |
+
sequence: float32
|
145 |
+
length: 2531
|
146 |
+
- name: DCOPF/dual/slack_bus
|
147 |
+
dtype: float32
|
148 |
+
- name: DCOPF/meta/seed
|
149 |
+
dtype: int64
|
150 |
+
- name: DCOPF/meta/formulation
|
151 |
+
dtype: string
|
152 |
+
- name: DCOPF/meta/primal_objective_value
|
153 |
+
dtype: float32
|
154 |
+
- name: DCOPF/meta/dual_objective_value
|
155 |
+
dtype: float32
|
156 |
+
- name: DCOPF/meta/primal_status
|
157 |
+
dtype: string
|
158 |
+
- name: DCOPF/meta/dual_status
|
159 |
+
dtype: string
|
160 |
+
- name: DCOPF/meta/termination_status
|
161 |
+
dtype: string
|
162 |
+
- name: DCOPF/meta/build_time
|
163 |
+
dtype: float32
|
164 |
+
- name: DCOPF/meta/extract_time
|
165 |
+
dtype: float32
|
166 |
+
- name: DCOPF/meta/solve_time
|
167 |
+
dtype: float32
|
168 |
+
- name: SOCOPF/primal/w
|
169 |
+
sequence: float32
|
170 |
+
length: 1888
|
171 |
+
- name: SOCOPF/primal/pg
|
172 |
+
sequence: float32
|
173 |
+
length: 290
|
174 |
+
- name: SOCOPF/primal/qg
|
175 |
+
sequence: float32
|
176 |
+
length: 290
|
177 |
+
- name: SOCOPF/primal/pf
|
178 |
+
sequence: float32
|
179 |
+
length: 2531
|
180 |
+
- name: SOCOPF/primal/pt
|
181 |
+
sequence: float32
|
182 |
+
length: 2531
|
183 |
+
- name: SOCOPF/primal/qf
|
184 |
+
sequence: float32
|
185 |
+
length: 2531
|
186 |
+
- name: SOCOPF/primal/qt
|
187 |
+
sequence: float32
|
188 |
+
length: 2531
|
189 |
+
- name: SOCOPF/primal/wr
|
190 |
+
sequence: float32
|
191 |
+
length: 2531
|
192 |
+
- name: SOCOPF/primal/wi
|
193 |
+
sequence: float32
|
194 |
+
length: 2531
|
195 |
+
- name: SOCOPF/dual/kcl_p
|
196 |
+
sequence: float32
|
197 |
+
length: 1888
|
198 |
+
- name: SOCOPF/dual/kcl_q
|
199 |
+
sequence: float32
|
200 |
+
length: 1888
|
201 |
+
- name: SOCOPF/dual/w
|
202 |
+
sequence: float32
|
203 |
+
length: 1888
|
204 |
+
- name: SOCOPF/dual/pg
|
205 |
+
sequence: float32
|
206 |
+
length: 290
|
207 |
+
- name: SOCOPF/dual/qg
|
208 |
+
sequence: float32
|
209 |
+
length: 290
|
210 |
+
- name: SOCOPF/dual/ohm_pf
|
211 |
+
sequence: float32
|
212 |
+
length: 2531
|
213 |
+
- name: SOCOPF/dual/ohm_pt
|
214 |
+
sequence: float32
|
215 |
+
length: 2531
|
216 |
+
- name: SOCOPF/dual/ohm_qf
|
217 |
+
sequence: float32
|
218 |
+
length: 2531
|
219 |
+
- name: SOCOPF/dual/ohm_qt
|
220 |
+
sequence: float32
|
221 |
+
length: 2531
|
222 |
+
- name: SOCOPF/dual/jabr
|
223 |
+
dtype:
|
224 |
+
array2_d:
|
225 |
+
shape:
|
226 |
+
- 2531
|
227 |
+
- 4
|
228 |
+
dtype: float32
|
229 |
+
- name: SOCOPF/dual/sm_fr
|
230 |
+
dtype:
|
231 |
+
array2_d:
|
232 |
+
shape:
|
233 |
+
- 2531
|
234 |
+
- 3
|
235 |
+
dtype: float32
|
236 |
+
- name: SOCOPF/dual/sm_to
|
237 |
+
dtype:
|
238 |
+
array2_d:
|
239 |
+
shape:
|
240 |
+
- 2531
|
241 |
+
- 3
|
242 |
+
dtype: float32
|
243 |
+
- name: SOCOPF/dual/va_diff
|
244 |
+
sequence: float32
|
245 |
+
length: 2531
|
246 |
+
- name: SOCOPF/dual/wr
|
247 |
+
sequence: float32
|
248 |
+
length: 2531
|
249 |
+
- name: SOCOPF/dual/wi
|
250 |
+
sequence: float32
|
251 |
+
length: 2531
|
252 |
+
- name: SOCOPF/dual/pf
|
253 |
+
sequence: float32
|
254 |
+
length: 2531
|
255 |
+
- name: SOCOPF/dual/pt
|
256 |
+
sequence: float32
|
257 |
+
length: 2531
|
258 |
+
- name: SOCOPF/dual/qf
|
259 |
+
sequence: float32
|
260 |
+
length: 2531
|
261 |
+
- name: SOCOPF/dual/qt
|
262 |
+
sequence: float32
|
263 |
+
length: 2531
|
264 |
+
- name: SOCOPF/meta/seed
|
265 |
+
dtype: int64
|
266 |
+
- name: SOCOPF/meta/formulation
|
267 |
+
dtype: string
|
268 |
+
- name: SOCOPF/meta/primal_objective_value
|
269 |
+
dtype: float32
|
270 |
+
- name: SOCOPF/meta/dual_objective_value
|
271 |
+
dtype: float32
|
272 |
+
- name: SOCOPF/meta/primal_status
|
273 |
+
dtype: string
|
274 |
+
- name: SOCOPF/meta/dual_status
|
275 |
+
dtype: string
|
276 |
+
- name: SOCOPF/meta/termination_status
|
277 |
+
dtype: string
|
278 |
+
- name: SOCOPF/meta/build_time
|
279 |
+
dtype: float32
|
280 |
+
- name: SOCOPF/meta/extract_time
|
281 |
+
dtype: float32
|
282 |
+
- name: SOCOPF/meta/solve_time
|
283 |
+
dtype: float32
|
284 |
+
splits:
|
285 |
+
- name: train
|
286 |
+
num_bytes: 211462962203
|
287 |
+
num_examples: 371587
|
288 |
+
- name: test
|
289 |
+
num_bytes: 52865882822
|
290 |
+
num_examples: 92897
|
291 |
+
download_size: 221548942567
|
292 |
+
dataset_size: 264328845025
|
293 |
+
---
|
case.json.gz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:04bef6d8d495d8968d096fdb549b8e646430bfcbd07037199ba0c3d483634c39
|
3 |
+
size 1448847
|
config.toml
ADDED
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Name of the reference PGLib case. Must be a valid PGLib case name.
|
2 |
+
pglib_case = "pglib_opf_case1888_rte"
|
3 |
+
floating_point_type = "Float32"
|
4 |
+
|
5 |
+
[sampler]
|
6 |
+
# data sampler options
|
7 |
+
[sampler.load]
|
8 |
+
noise_type = "ScaledUniform"
|
9 |
+
l = 0.7 # Lower bound of base load factor
|
10 |
+
u = 1.1 # Upper bound of base load factor
|
11 |
+
sigma = 0.20 # Relative (multiplicative) noise level.
|
12 |
+
|
13 |
+
|
14 |
+
[OPF]
|
15 |
+
|
16 |
+
[OPF.ACOPF]
|
17 |
+
type = "ACOPF"
|
18 |
+
solver.name = "Ipopt"
|
19 |
+
solver.attributes.tol = 1e-6
|
20 |
+
solver.attributes.linear_solver = "ma27"
|
21 |
+
|
22 |
+
[OPF.DCOPF]
|
23 |
+
# Formulation/solver options
|
24 |
+
type = "DCOPF"
|
25 |
+
solver.name = "HiGHS"
|
26 |
+
|
27 |
+
[OPF.SOCOPF]
|
28 |
+
type = "SOCOPF"
|
29 |
+
solver.name = "Clarabel"
|
30 |
+
# Tight tolerances
|
31 |
+
solver.attributes.tol_gap_abs = 1e-6
|
32 |
+
solver.attributes.tol_gap_rel = 1e-6
|
33 |
+
solver.attributes.tol_feas = 1e-6
|
34 |
+
solver.attributes.tol_infeas_rel = 1e-6
|
35 |
+
solver.attributes.tol_ktratio = 1e-6
|
36 |
+
# Reduced accuracy settings
|
37 |
+
solver.attributes.reduced_tol_gap_abs = 1e-6
|
38 |
+
solver.attributes.reduced_tol_gap_rel = 1e-6
|
39 |
+
solver.attributes.reduced_tol_feas = 1e-6
|
40 |
+
solver.attributes.reduced_tol_infeas_abs = 1e-6
|
41 |
+
solver.attributes.reduced_tol_infeas_rel = 1e-6
|
42 |
+
solver.attributes.reduced_tol_ktratio = 1e-6
|
infeasible/ACOPF/dual.h5.gz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:198c13db2590bdd260dbee140dfe9a938964f9c86c87a1604ef6bdfe24d4b539
|
3 |
+
size 4374420083
|
infeasible/ACOPF/meta.h5.gz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:b2c6cf37eff40ed8fc1cd9a2ac11f7fffb20d0a0cb2240b6f351812dd01b3a35
|
3 |
+
size 1174026
|
infeasible/ACOPF/primal.h5.gz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:df254bdf46c8344aa95f2d8dcf87f3d4aaa749fde1e242c322bc5eeddc5f96e2
|
3 |
+
size 1845622252
|
infeasible/DCOPF/dual.h5.gz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:a14b5a5e883f7f9c885e69b7c63624434d4affa38a71dd9843c9a9f0439a3693
|
3 |
+
size 133608111
|
infeasible/DCOPF/meta.h5.gz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:73f147a445190cc6de1a6efdbcaf395e351720c61f4b71eda47624110b2a8172
|
3 |
+
size 1188365
|
infeasible/DCOPF/primal.h5.gz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:95109b8bfcfb0d0814c0f4f8469fbb24bf8b4ff8f4fab96bbe2de35488d6d1d3
|
3 |
+
size 521286630
|
infeasible/SOCOPF/dual.h5.gz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:a43f76dd4e89bf68e5f68a383ac66a158883b0b728d09a1e77e820801c5d2a87
|
3 |
+
size 7345156989
|
infeasible/SOCOPF/meta.h5.gz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:1acaf7a04ce943510515818d3bf59391ea61410c474f6ee71694ea6ead6bf62d
|
3 |
+
size 1242153
|
infeasible/SOCOPF/primal.h5.gz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:0e7a6670e7ec7ea3c53c5f099b770b613c139fe634f12b15065bcfd3f7f1de9f
|
3 |
+
size 2141884604
|
infeasible/input.h5.gz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:4468d12fb16dbc0edd81529a0ccdebefa75ebb22216e5230143fd2d1b4bc8615
|
3 |
+
size 262430198
|
test/ACOPF/dual.h5.gz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:035345139ba10243192f6b59a2333643de031651787b4933ae815431e50ea33d
|
3 |
+
size 10176519735
|
test/ACOPF/meta.h5.gz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:9c56d1db5ade25fc2db37b3ea1b41cb82aefc65a9bcfe4aa5672d70b3d177f6d
|
3 |
+
size 3168804
|
test/ACOPF/primal.h5.gz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:2e2f39aa14286d080209312eccd91986e2c8058ac3ba980a95246e9fc82a2302
|
3 |
+
size 4599883525
|
test/DCOPF/dual.h5.gz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:ec2261a7a3d586c1761db089d5455e17031a84251579dc88b6ad71ae0d54a4c8
|
3 |
+
size 366996811
|
test/DCOPF/meta.h5.gz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:4e4dc1361c5dcc4115d39c6b40ac955916863d7766132e7a34921eeb85030a82
|
3 |
+
size 3080732
|
test/DCOPF/primal.h5.gz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:18e68bfc4ec46c8cd71d15d21fa48958a880ba7232a64a33e9e090bd0ef328f1
|
3 |
+
size 1367542973
|
test/SOCOPF/dual.h5.gz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:20bc17ca1d3f0c812401373324fc1ea41c4eb6bd39f814c572d11b3b866eabc8
|
3 |
+
size 19218771667
|
test/SOCOPF/meta.h5.gz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:52d38ffdacbabc4cbe184e54730eec544a3a8262d01ad9981e8f72f8929b8d21
|
3 |
+
size 3164796
|
test/SOCOPF/primal.h5.gz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:be5607be029b86da66c40c96523b4bae3352ff18ad7b9ad77c73f240972f0ac7
|
3 |
+
size 5602374327
|
test/input.h5.gz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:b980b40b75853cac97771fcda5fdcc0cb4bdcda4ba174cbfa899711397ca115a
|
3 |
+
size 686700820
|
train/ACOPF/dual.h5.gz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:f57ce97db72c9c5a1004f54fafd4a2fa59011faa9f89d9dd5a4303a5bf4f3145
|
3 |
+
size 40707507061
|
train/ACOPF/meta.h5.gz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:95192d529b145badad7f793741ad52185ce786733073ac558163399eafa0c15a
|
3 |
+
size 12624833
|
train/ACOPF/primal.h5.gz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:fa78b43be055ed49846700422c95fab87d8588ef99f7845985c584c5cc18d701
|
3 |
+
size 18399494055
|
train/DCOPF/dual.h5.gz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:2f3084c9f9176009353d7e9ab7d63a7e9c9ad7d38f4c95f107dcd9b6c499093d
|
3 |
+
size 1468058276
|
train/DCOPF/meta.h5.gz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:9b9605989aeb000f49cd466f1e57320a1999601ff796998d1575c4870c433801
|
3 |
+
size 12269505
|
train/DCOPF/primal.h5.gz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:18f6bb21abfc73536bb267138cf607a104102f23918ae83c6cb6855c6a4bde1b
|
3 |
+
size 5470207642
|
train/SOCOPF/dual/xaa
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:91b0c75c754e5e83badbb4bfcb654bcba20aa654ced1d872327a75b9d0d1952e
|
3 |
+
size 32212254720
|
train/SOCOPF/dual/xab
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:03a236c323dc9f86d70cefe8673c82b8ea0d31c809a3044070d83010877b840a
|
3 |
+
size 32212254720
|
train/SOCOPF/dual/xac
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:0c604ec6a63ead93e753ab77cf7d7094d09b768aa04286841084dcaf372f1f70
|
3 |
+
size 23857138212
|
train/SOCOPF/meta.h5.gz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:63dea48a5bf560b30aa3952ce5e805fba903bff8a31435c13326a6716f773cd9
|
3 |
+
size 12608098
|
train/SOCOPF/primal.h5.gz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:62c9552d4bd791d0cc5119a5db42f1f4c6e63fab4fcd79e7446f3402ad3b6b33
|
3 |
+
size 22409529912
|
train/input.h5.gz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:329792fd7c86372bdc072a688b9717c32ec14e887361189989d1f7ca4e017cef
|
3 |
+
size 2746791343
|