Datasets:
Convert dataset to Parquet (part 00009-of-00010) (#10)
Browse files- Convert dataset to Parquet (part 00009-of-00010) (a5c8ac667dfc6290d214317378372b24cbaf515c)
- Delete loading script (c5b82eb49745ffed1b0d14120100c99c6700bb4e)
- Delete data file (96f22cd6db57d94b6b8c1f1f6fb362a13515fbca)
- Delete data file (7d00037fe03d8d7f79f85a90f931a7b9f60afb29)
- Delete data file (c23e0b7dd62d90be70e37fb49cf5ac13cce2a9c7)
- Delete data file (396b771de76eb953d51a82fed3f3eab99bc2f662)
- Delete data file (5b0804c5f75b99b7084515dea2032cce106c91d7)
- Delete data file (2d08b1731fce02cde8189effa323daa9d353a4e0)
- Delete data file (3751f1cad28f261bc43e5ea317a0a35d2e8154b7)
- Delete data file (077c444f55a9cdb0748216f0fc4b9c1861b468b0)
- Delete data file (7a88037aa3b61c80d33f931f70f9efb21a25d971)
- Delete data file (232e376ed77a43ff79917a3d37d3dfc61960edb8)
- Delete data file (382b56197d54192af1d10cee9286e0be5595d006)
- Delete data file (2cc904b57f2a9c789427a88b6169b5a276d6df9c)
- Delete data file (b118ecbdc3d49e1cdc7f8e22084d0e2b10031b07)
- Delete data file (0cea9e1533ae58e092c1a13b2032c99b976b2253)
- Delete data file (09792fe7e752e9fd13fa25f6e29e7eddd3506786)
- Delete data file (25d52f8fb938128705c452e8a4c3a5f4c5675f48)
- Delete data file (2c9eeccec32d6f94df0acf25150e986ecdb836db)
- Delete data file (a630c00352088f9339e52cf4372962088cb1b2cc)
- Delete data file (8ffb4f9d320ae2e01a9802b64176c826ab405947)
- Delete data file (a084c7598fb656939c51596f858071e57417be7c)
- Delete data file (53d15dc28431a1a7f9b5f624d2a8cf03cc327414)
- Delete data file (d78d27d99469b0218eb2eb1488915b5941599e27)
- Delete data file (aa9fed8e6f87e63e9857f3eda07f53d90f131bcb)
- Delete data file (14cbd07cb0543bfa86f34fbfe6a159516b54160f)
- Delete data file (263413bb7252f6f721ae7e93453d76291863dfff)
- Delete data file (d211b87c969ab0d3a4abc66ba287e73a9765cead)
- Delete data file (04b961cd32c072e32aed9339054d2c62c5d0d5eb)
- Delete data file (e4b5c3a7410754809794b33ff1bd42c8d3a66d9b)
- Delete data file (a797cd721dd4a5610ddd35ffdac21edd2d657ac2)
- Delete data file (abaced310271af7aef1c8fe2fd0d46e7334c4916)
- Delete data file (6e3ca751e2b4e5fd9ff3e102d1cb04af8012482d)
- Delete data file (3118851532f84681a5998b06d7d8d99817f1314b)
- Delete data file (58817771acce4c019d5c606abb516da47be716f1)
- Delete data file (0a47d1765bdc603cd7669ed41d8030922b8c5f7b)
- Delete data file (9227db55d651a30385a9aca1dc394bd35863ff3f)
- Delete data file (1fab4c164f58d9c1fb7da7fbd647519056928a13)
- Delete data file (89d3d449de64457d8a17762b79b965676e92d736)
- Delete data file (849f3aac6ca50dd7e348cf248dd500e373a236d9)
- Delete data file (941f8da9b3cfe4f017fa9090ca9a4c380eb456d9)
- Delete data file (d4d3593601b88b6967c95c532891277832ff8abe)
- Delete data file (6ba196cd863e3e92696eb03012172e7e92baa912)
- Delete data file (966fb6a4a49e4c5bcb617a485545f5a54e7d5a74)
- Delete data file (50bfa117b0d26f3b15841f4aa06bebcce6485e71)
- Delete data file (4f1140f6a53afb38525584f721b2fee98092f674)
- Delete data file (18451d65460d2bfbef770bf416d4e8c64cbc0dd8)
- Delete data file (453f24366bda83a220a260931440c0c6c1dec193)
- Delete data file (21a6351e83a8820f3ec57d53919eeccefcc604aa)
- Delete data file (38cc9eb4fe60ba1ec4f66d4720bf00f3eec16441)
- Delete data file (bba48b4a32412107307a681dc336df185d5fa6a0)
- Delete data file (b16f29ce250fa02b70e23a3fca3803208b035c23)
- Delete data file (485ebba53e3bd1b6c61afd6ccde1f97294a63afb)
- Delete data file (37302d250dd6695913e3df71490fb964b7381580)
- infeasible/ACOPF/meta.h5.gz → 2869_pegase/test-00071-of-00095.parquet +2 -2
- case.json.gz → 2869_pegase/test-00072-of-00095.parquet +2 -2
- infeasible/DCOPF/dual.h5.gz → 2869_pegase/test-00073-of-00095.parquet +2 -2
- infeasible/DCOPF/meta.h5.gz → 2869_pegase/test-00074-of-00095.parquet +2 -2
- 2869_pegase/test-00075-of-00095.parquet +3 -0
- 2869_pegase/test-00076-of-00095.parquet +3 -0
- 2869_pegase/test-00077-of-00095.parquet +3 -0
- 2869_pegase/test-00078-of-00095.parquet +3 -0
- 2869_pegase/test-00079-of-00095.parquet +3 -0
- 2869_pegase/test-00080-of-00095.parquet +3 -0
- 2869_pegase/test-00081-of-00095.parquet +3 -0
- 2869_pegase/test-00082-of-00095.parquet +3 -0
- 2869_pegase/test-00083-of-00095.parquet +3 -0
- 2869_pegase/test-00084-of-00095.parquet +3 -0
- 2869_pegase/test-00085-of-00095.parquet +3 -0
- 2869_pegase/test-00086-of-00095.parquet +3 -0
- 2869_pegase/test-00087-of-00095.parquet +3 -0
- 2869_pegase/test-00088-of-00095.parquet +3 -0
- 2869_pegase/test-00089-of-00095.parquet +3 -0
- 2869_pegase/test-00090-of-00095.parquet +3 -0
- 2869_pegase/test-00091-of-00095.parquet +3 -0
- 2869_pegase/test-00092-of-00095.parquet +3 -0
- 2869_pegase/test-00093-of-00095.parquet +3 -0
- 2869_pegase/test-00094-of-00095.parquet +3 -0
- PGLearn-Medium-2869_pegase.py +0 -429
- README.md +9 -1
- config.toml +0 -54
- infeasible/ACOPF/dual.h5.gz +0 -3
- infeasible/ACOPF/primal.h5.gz +0 -3
- infeasible/DCOPF/primal.h5.gz +0 -3
- infeasible/SOCOPF/dual.h5.gz +0 -3
- infeasible/SOCOPF/meta.h5.gz +0 -3
- infeasible/SOCOPF/primal.h5.gz +0 -3
- infeasible/infeasible/ACOPF/dual.h5.gz +0 -3
- infeasible/infeasible/ACOPF/meta.h5.gz +0 -3
- infeasible/infeasible/ACOPF/primal.h5.gz +0 -3
- infeasible/infeasible/DCOPF/dual.h5.gz +0 -3
- infeasible/infeasible/DCOPF/meta.h5.gz +0 -3
- infeasible/infeasible/DCOPF/primal.h5.gz +0 -3
- infeasible/infeasible/SOCOPF/dual.h5.gz +0 -3
- infeasible/infeasible/SOCOPF/meta.h5.gz +0 -3
- infeasible/infeasible/SOCOPF/primal.h5.gz +0 -3
- infeasible/infeasible/input.h5.gz +0 -3
- infeasible/input.h5.gz +0 -3
- test/ACOPF/dual.h5.gz +0 -3
- test/ACOPF/meta.h5.gz +0 -3
- test/ACOPF/primal.h5.gz +0 -3
- test/DCOPF/dual.h5.gz +0 -3
- test/DCOPF/meta.h5.gz +0 -3
- test/DCOPF/primal.h5.gz +0 -3
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:b8e122925add1c7245f60fe09743bcd344138def055c2d6436bc003b32f701fa
|
3 |
+
size 496259423
|
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:207b899abd4b25336b684ff05f99a623cbbb07690cc7c85d5e9fa911cf1a2277
|
3 |
+
size 496202430
|
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:8f40dcc2afcdd6878f6c33652338f4abea2addcc6a8a3a552b8ab47b9a8b26c6
|
3 |
+
size 496162755
|
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:67e70465b93e7c571e6a2adc84f02aeb1b895b2a69b72bb34ded2a68e3e5083e
|
3 |
+
size 496122897
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:a140324f6e4f192433a6565fc22d74732de3aad859540c6aa40a1e91e36b99fe
|
3 |
+
size 496129185
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:e0d0d56d015026cdd40a308b0b530bb738d40e1a50229990b59bfae28dc8e2e9
|
3 |
+
size 496185499
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:8f51565fc6063d38fbff10f225fae637ca4f8f1041d59a1bf2ea8a8531abe342
|
3 |
+
size 496129102
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:e376b0f448ec1b2f233ad403bdb601dd58bee7d12031b56148ea2dd5493ae59f
|
3 |
+
size 496133069
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:f5093380b79df45485410805498055232f9c7a3fb09c0e5f8ffc9baa7ddb50da
|
3 |
+
size 496063084
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:70b7a3c14986fc4defdf034ba9a229e6d25965e4592abb87bb8e0d40af78611b
|
3 |
+
size 496202907
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:bae49ed6724a7b76ff1d7d6f1935d9473d4c84e8bc4e6fc71962b6f190754ab1
|
3 |
+
size 496146961
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:966a2110f19bb8fd87206a1f83be3b89068e870b1aba7ec887818aaa392f3e43
|
3 |
+
size 496097317
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:c95f05c8c9b13a091d3b4b16c1c4c4edc1778ac355670f834589606ec191c55d
|
3 |
+
size 496198386
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:490dd1f6ad3cef351ecec7bf81c60c964177d4ee08ea6eebde5bd196f2cae026
|
3 |
+
size 496101290
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:7b05c4671141f7f4e4ff49fe826b653cef030e91ba451233eb6dfef567ac0daf
|
3 |
+
size 496255255
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:9e463b88b787b95146366362b456bc31b23f9cbebfa8a29a3ff4fb1afb0af93a
|
3 |
+
size 495980383
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:30869d78cb56b96b2975c328b215f845dd91b9b85c91d6e819e599914da35860
|
3 |
+
size 496193942
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:1e891910c0cb9c07197da5ebc4500f1aa6a960eab8bdde2e077e9c5c3206a94e
|
3 |
+
size 496176264
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:37582b9c86e0aac54a8d8d3c0784bec37043a5732740732627733f0e24657c78
|
3 |
+
size 496071245
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:d44a6f43e6d6109c598fa9c7661a3c423e4b6e86d38624ace5911da881a82419
|
3 |
+
size 496102549
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:6458d977ef2dbe4a6825bb08ecba9e2f506e1b447a225c7ad3e927d08efb310b
|
3 |
+
size 496147378
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:e6b70ca7f22c89b000cc94fa86faef7e8d364871a3141daed55e4dd9a60f3b77
|
3 |
+
size 496129161
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:5c60b57dce35254696176c11108f5a425e8572ac0cbded72dbfa43bbf0d8db50
|
3 |
+
size 496074629
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:ffdc9a1e1659b65a59033226f9c7c3b3f30702045ac51b180ac88490447fdec6
|
3 |
+
size 496137557
|
@@ -1,429 +0,0 @@
|
|
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 = "2869_pegase"
|
24 |
-
SIZES = CaseSizes(n_bus=2869, n_load=1491, n_gen=510, n_branch=4582)
|
25 |
-
NUM_TRAIN = 188545
|
26 |
-
NUM_TEST = 47137
|
27 |
-
NUM_INFEASIBLE = 14322
|
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-2869_pegase"
|
33 |
-
DESCRIPTION = """\
|
34 |
-
The 2869_pegase 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-2869_pegase/blob/script/case.json.gz
|
42 |
-
"""
|
43 |
-
USE_ML4OPF_WARNING = """
|
44 |
-
================================================================================================
|
45 |
-
Loading PGLearn-Medium-2869_pegase 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-2869_pegase#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 PGLearnMedium2869_pegaseConfig(hfd.BuilderConfig):
|
100 |
-
"""BuilderConfig for PGLearn-Medium-2869_pegase.
|
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(PGLearnMedium2869_pegaseConfig, 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 PGLearnMedium2869_pegase(hfd.ArrowBasedBuilder):
|
210 |
-
"""DatasetBuilder for PGLearn-Medium-2869_pegase.
|
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-2869_pegase", 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 = PGLearnMedium2869_pegaseConfig
|
226 |
-
DEFAULT_CONFIG_NAME=CASENAME
|
227 |
-
BUILDER_CONFIGS = [
|
228 |
-
PGLearnMedium2869_pegaseConfig(
|
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")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -288,6 +288,14 @@ dataset_info:
|
|
288 |
- name: test
|
289 |
num_bytes: 47261465249
|
290 |
num_examples: 47137
|
291 |
-
download_size:
|
292 |
dataset_size: 236304318322
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
293 |
---
|
|
|
288 |
- name: test
|
289 |
num_bytes: 47261465249
|
290 |
num_examples: 47137
|
291 |
+
download_size: 235716403370
|
292 |
dataset_size: 236304318322
|
293 |
+
configs:
|
294 |
+
- config_name: 2869_pegase
|
295 |
+
data_files:
|
296 |
+
- split: train
|
297 |
+
path: 2869_pegase/train-*
|
298 |
+
- split: test
|
299 |
+
path: 2869_pegase/test-*
|
300 |
+
default: true
|
301 |
---
|
@@ -1,54 +0,0 @@
|
|
1 |
-
export_dir = "data/pglearn/2869_pegase"
|
2 |
-
# Name of the reference PGLib case. Must be a valid PGLib case name.
|
3 |
-
pglib_case = "pglib_opf_case2869_pegase"
|
4 |
-
floating_point_type = "Float32"
|
5 |
-
|
6 |
-
[sampler]
|
7 |
-
# data sampler options
|
8 |
-
[sampler.load]
|
9 |
-
noise_type = "ScaledUniform"
|
10 |
-
l = 0.6 # Lower bound of base load factor
|
11 |
-
u = 1.0 # Upper bound of base load factor
|
12 |
-
sigma = 0.20 # Relative (multiplicative) noise level.
|
13 |
-
|
14 |
-
|
15 |
-
[OPF]
|
16 |
-
|
17 |
-
[OPF.ACOPF]
|
18 |
-
type = "ACOPF"
|
19 |
-
solver.name = "Ipopt"
|
20 |
-
solver.attributes.tol = 1e-6
|
21 |
-
solver.attributes.linear_solver = "ma27"
|
22 |
-
|
23 |
-
[OPF.DCOPF]
|
24 |
-
# Formulation/solver options
|
25 |
-
type = "DCOPF"
|
26 |
-
solver.name = "HiGHS"
|
27 |
-
|
28 |
-
[OPF.SOCOPF]
|
29 |
-
type = "SOCOPF"
|
30 |
-
solver.name = "Clarabel"
|
31 |
-
# Tight tolerances
|
32 |
-
solver.attributes.tol_gap_abs = 1e-6
|
33 |
-
solver.attributes.tol_gap_rel = 1e-6
|
34 |
-
solver.attributes.tol_feas = 1e-6
|
35 |
-
solver.attributes.tol_infeas_rel = 1e-6
|
36 |
-
solver.attributes.tol_ktratio = 1e-6
|
37 |
-
# Reduced accuracy settings
|
38 |
-
solver.attributes.reduced_tol_gap_abs = 1e-6
|
39 |
-
solver.attributes.reduced_tol_gap_rel = 1e-6
|
40 |
-
solver.attributes.reduced_tol_feas = 1e-6
|
41 |
-
solver.attributes.reduced_tol_infeas_abs = 1e-6
|
42 |
-
solver.attributes.reduced_tol_infeas_rel = 1e-6
|
43 |
-
solver.attributes.reduced_tol_ktratio = 1e-6
|
44 |
-
|
45 |
-
[slurm]
|
46 |
-
n_samples = 500000
|
47 |
-
n_jobs = 44
|
48 |
-
minibatch_size = 32
|
49 |
-
cpus_per_task = 8
|
50 |
-
queue = "embers"
|
51 |
-
charge_account = "gts-phentenryck3-ai4opt"
|
52 |
-
sysimage_memory = "128G"
|
53 |
-
sampler_memory = "8G"
|
54 |
-
extract_memory = "500G"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:0a0352d40f0ef2bdc7d2df9954fac16c8850ad80bc0672b1b1863b07a8842c31
|
3 |
-
size 2904102983
|
|
|
|
|
|
|
|
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:9cbf7b2535543ff4f665452e52855ef34e89abeb37d1ca93423caad267670ba5
|
3 |
-
size 1301980774
|
|
|
|
|
|
|
|
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:39c367f5e8ba954fb047efe9524c344112607ca5c683ba4248b6e1fd67923ba9
|
3 |
-
size 317734691
|
|
|
|
|
|
|
|
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:d31725558aceabee4dd3b5952e3fc2ee997b67889aa2da60d687c8c738d460a3
|
3 |
-
size 5348844329
|
|
|
|
|
|
|
|
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:4db0022de3b09b7a2f68eeb3128f1fda91ce13eba9d054f320089490ec0bd336
|
3 |
-
size 461791
|
|
|
|
|
|
|
|
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:34130b305f1e0f697c444c1d84263b393a1a7759c147b7700e987c0546371bd2
|
3 |
-
size 1608636167
|
|
|
|
|
|
|
|
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:e682094778ecf7fe58ab05fd652db679572b8c50e69d01364563c2eb57d8e219
|
3 |
-
size 5868059017
|
|
|
|
|
|
|
|
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:c7a9b5abceb1931e5b8cd9fab8573a70916fc99c0b6f970fcc6c83ac7e1e02ac
|
3 |
-
size 1037110
|
|
|
|
|
|
|
|
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:b0baf4e2af56ecb608a34d77343500f437a491f6572686ba65d2283e1a5089ec
|
3 |
-
size 2631012101
|
|
|
|
|
|
|
|
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:75557d41d14c128fc2fd86f6ed8aac6e28180d7352ddbdce0ee900d66f87445b
|
3 |
-
size 545608239
|
|
|
|
|
|
|
|
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:aaef3b348e8c3b9e6385b05f2ba10c976475099de535048c20ed80fc3eacaef9
|
3 |
-
size 1016252
|
|
|
|
|
|
|
|
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:cfc3ff7ef54bc6842c063e2ad8201a20ce03412a0993e3b7c2bf3308f8edd611
|
3 |
-
size 642928188
|
|
|
|
|
|
|
|
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:98dfabcabdcf2079e4a7c011ec14938634cf681facb9fb23d6470673014207de
|
3 |
-
size 10810611716
|
|
|
|
|
|
|
|
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:ab63da5ff9e3ee6adf61f436797c1a1837ba3d2598a9a09861b751516f7c0b0d
|
3 |
-
size 920082
|
|
|
|
|
|
|
|
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:99b8a59396f974ad7146fdaf341f559135b8a5e183ff8a26213ba4668149a782
|
3 |
-
size 3251218859
|
|
|
|
|
|
|
|
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:484faabd1dc5dac19806e6822552ef166ee949e9e89cc3aaa7ddaee70eca4984
|
3 |
-
size 316834914
|
|
|
|
|
|
|
|
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:a4e9c3da76a5ac0daf19c7f3eddab342be521f28aad5953d91e40793fc36c07c
|
3 |
-
size 156768362
|
|
|
|
|
|
|
|
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:a727aa4c101eb4c4c8003098eb10913b43fe39071b9d2df496220077a93a2610
|
3 |
-
size 9213784136
|
|
|
|
|
|
|
|
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:a82a2d9382c1f7fa2030ed3c998126209dd1c5e0ce5d24f4413fdcbf35b39283
|
3 |
-
size 1600620
|
|
|
|
|
|
|
|
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:c67900776466488c6546e9d963d2519b9059defb3bf5fd2a78e6c8967f6aec1f
|
3 |
-
size 4249836822
|
|
|
|
|
|
|
|
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:c1c3f08a5c54c3540d9dc898116b887ea0c12e0e01c42159d170dbd2426f8557
|
3 |
-
size 1041360188
|
|
|
|
|
|
|
|
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:5bc5ff33e29a962375a14cb9502521ca39b98216b9fcf780b8ad90bca9cf302a
|
3 |
-
size 1595126
|
|
|
|
|
|
|
|
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:3701a26453344762cec746801f7b1ce240e802d2b56b3b5668afaeed41dee3f4
|
3 |
-
size 1222237308
|
|
|
|
|
|
|
|