Datasets:
Convert dataset to Parquet (part 00010-of-00011) (#11)
Browse files- Convert dataset to Parquet (part 00010-of-00011) (30143035b21d1092bc75c98e7b6793bab5fba4d0)
- Delete data file (2ad7fd858b2f7bf1ac8d86efd230e820c5d60624)
- Delete loading script (b0f6f07ef880587d89e0a44a8a92d64567365975)
- Delete data file (57c442965c2355b09203c5bcc5776c10bcf2dc24)
- Delete data file (4c1b3cb82d57418b1f739a80ff55b3f417466640)
- Delete data file (50e143b13a97077ccdcda9d08138087268fe765b)
- Delete data file (404ac37bcdcf17519bc88492b3eeb55ee748c52d)
- Delete data file (4f7278434d9609333e85892e7bbd826136e41693)
- Delete data file (683c27119d9f9a1c9c97c4706ece6534e5037b44)
- Delete data file (3cc5034e34937cd5051ad27060d53e4e9c55238d)
- Delete data file (970b4e4188f9fa05ca1ca81d9cc6413e37d3730a)
- Delete data file (7a4ad98d0f4b7e7fbf1c485250cbbfe5500b2227)
- Delete data file (1e36beca2ff28ec9855c4c22fc20a8a5c8842fe3)
- Delete data file (1a2b3752c70555aa19cfed4ff6631e95d6a38ae1)
- Delete data file (716769a2c34e4158cc018c030ec0d3ad777d395a)
- Delete data file (9b95bf8ad3ae6d6e30c09e5d54f5cb75f9068e5e)
- Delete data file (86d0a1eeea0b4773b79b4d06a30eee386bb5f3ea)
- Delete data file (a2382b42740f976a2e292d9d61ac4bc30d806559)
- Delete data file (a004c1ac6b16b3a7682153791827768124a6a867)
- Delete data file (7f8f3053fe899aae00271f1ce48a83a6a2c14a8b)
- Delete data file (9ad4d54236314a7e6d7db755b6f357d49d1e945f)
- Delete data file (27ce0b3f293f681625685d248338bb1685f85dc2)
- Delete data file (811c72eebb90856aa9bc4190857313f18d27857b)
- Delete data file (f0e82576fc570fa1186aedd6e8dbb983cc3da2f0)
- Delete data file (aed99bc8cb5360ba1781914dd1d319f279eb855d)
- Delete data file (b04edaf0a3b11ecc28792146573a0ce6f8fd426a)
- Delete data file (e28e976baa0590978cf134919534f4032b278c25)
- Delete data file (a350b762754e7a1eb88dd2e0a5a3e70dafe26d30)
- Delete data file (7dd35ae232fd946dbb323581b6c92b3755aea2cb)
- Delete data file (6e3bf2ca5d47ea3b9c1c35adca510b8dfa894762)
- Delete data file (23a856b08094d26c026a897236bec7c9f03c62c9)
- Delete data file (6fe716171a36eb82981c6718fa9293855b6c6678)
- Delete data file (0b26e237cd6f5677d7385a06caab192954e128db)
- Delete data file (374be6504b912eb0b52b0acb3341bf578c7e79b6)
- Delete data file (889ace5a9608a4716d8ec5f867e22c9b5aeeaf1e)
- Delete data file (6e5c62ef73cf8980310b24b4092afd9a2aa89db7)
- infeasible/ACOPF/meta.h5.gz → 9241_pegase-nminus1/test-00076-of-00106.parquet +2 -2
- case.json.gz → 9241_pegase-nminus1/test-00077-of-00106.parquet +2 -2
- infeasible/DCOPF/meta.h5.gz → 9241_pegase-nminus1/test-00078-of-00106.parquet +2 -2
- infeasible/SOCOPF/meta.h5.gz → 9241_pegase-nminus1/test-00079-of-00106.parquet +2 -2
- 9241_pegase-nminus1/test-00080-of-00106.parquet +3 -0
- 9241_pegase-nminus1/test-00081-of-00106.parquet +3 -0
- 9241_pegase-nminus1/test-00082-of-00106.parquet +3 -0
- 9241_pegase-nminus1/test-00083-of-00106.parquet +3 -0
- 9241_pegase-nminus1/test-00084-of-00106.parquet +3 -0
- 9241_pegase-nminus1/test-00085-of-00106.parquet +3 -0
- 9241_pegase-nminus1/test-00086-of-00106.parquet +3 -0
- 9241_pegase-nminus1/test-00087-of-00106.parquet +3 -0
- 9241_pegase-nminus1/test-00088-of-00106.parquet +3 -0
- 9241_pegase-nminus1/test-00089-of-00106.parquet +3 -0
- 9241_pegase-nminus1/test-00090-of-00106.parquet +3 -0
- 9241_pegase-nminus1/test-00091-of-00106.parquet +3 -0
- 9241_pegase-nminus1/test-00092-of-00106.parquet +3 -0
- 9241_pegase-nminus1/test-00093-of-00106.parquet +3 -0
- 9241_pegase-nminus1/test-00094-of-00106.parquet +3 -0
- 9241_pegase-nminus1/test-00095-of-00106.parquet +3 -0
- 9241_pegase-nminus1/test-00096-of-00106.parquet +3 -0
- 9241_pegase-nminus1/test-00097-of-00106.parquet +3 -0
- 9241_pegase-nminus1/test-00098-of-00106.parquet +3 -0
- 9241_pegase-nminus1/test-00099-of-00106.parquet +3 -0
- 9241_pegase-nminus1/test-00100-of-00106.parquet +3 -0
- 9241_pegase-nminus1/test-00101-of-00106.parquet +3 -0
- 9241_pegase-nminus1/test-00102-of-00106.parquet +3 -0
- 9241_pegase-nminus1/test-00103-of-00106.parquet +3 -0
- 9241_pegase-nminus1/test-00104-of-00106.parquet +3 -0
- 9241_pegase-nminus1/test-00105-of-00106.parquet +3 -0
- PGLearn-Large-9241_pegase-nminus1.py +0 -429
- README.md +9 -1
- config.toml +0 -44
- infeasible/ACOPF/dual.h5.gz +0 -3
- infeasible/ACOPF/primal.h5.gz +0 -3
- infeasible/DCOPF/dual.h5.gz +0 -3
- infeasible/DCOPF/primal.h5.gz +0 -3
- infeasible/SOCOPF/dual.h5.gz +0 -3
- infeasible/SOCOPF/primal.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
- test/SOCOPF/dual.h5.gz +0 -3
- test/SOCOPF/meta.h5.gz +0 -3
- test/SOCOPF/primal.h5.gz +0 -3
- test/input.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:deadb3a61a89878dd76d368b48565ca5da5a696386c8eb870d2ebb0433140b1c
|
3 |
+
size 498375167
|
@@ -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:1b2c3a73564912797c060b9b781b4cc71297aa8e7747e3de4e511dfae6b18434
|
3 |
+
size 498381922
|
@@ -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:a14e3cdd83248da59371c734711c84e650a850d6c20e3a5442c0c5207e29c888
|
3 |
+
size 498402267
|
@@ -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:d8e0a374d6e5c9b13a817121896bb8aa937529bd0f19c991b5a5bb4f4fa010e0
|
3 |
+
size 498390779
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:fe19a3b4f7dc8feb3a3831aa1c417929ee40710873c713594035eeed3d80c2b6
|
3 |
+
size 498427958
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:5bd732604e212800c2717da6ca5a3a14e61e0369b71a788d66aa0d3870e71eaa
|
3 |
+
size 498402419
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:fc6c745c02b2356c06ed842fdfcdcece6ee5c0274dac17e2caad5612b828aecd
|
3 |
+
size 498397102
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:de1307a53f04e790a9ac8a14e755b0ebaf3dd6308fa236e2b252417db686891a
|
3 |
+
size 498414343
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:add9f647c6acce7ee79e1139959af3f7cd3745bc977c41226e3d10cb0ab9e48a
|
3 |
+
size 498404810
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:a8727ace6c53693fed95429b66e512cc3cb7affc9928a33a93884896e8363447
|
3 |
+
size 498416679
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:cf5687f3e3cde2f82ee8f51d02ad228a9a314ed0b7b4c06a9ce561d3e06315f6
|
3 |
+
size 498453104
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:6a1bbebcacb941c02c940cae2be7ba18b3bc36b044e0a36a27b80b4d3972049b
|
3 |
+
size 498476946
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:78cc2784ff37a4b810dee5006dd81bfa9e1e71e18b56ee43307c36e2cad9cb2b
|
3 |
+
size 498347712
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:390748b3d79d65d2f5dbd7aa2ef91dd96e46bd4746e110f0fa238b6bac282560
|
3 |
+
size 498405600
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:d19c28ec2ea537ff4d997b5e071810b927c367c5a7a4ec45f3149c065b192818
|
3 |
+
size 498477471
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:88ca5baa597bff08fc54e580e8d00b21178d5a47995ea472eaf4025c188c0a0a
|
3 |
+
size 498546376
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:a6e08dd480914623a2f056133ac4f08a37dd33d41713a135efc139e41873d5fd
|
3 |
+
size 498407563
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:b10a9b1a665b93e69f4d830827ca4b6322a3b6e7b9bb494ab87b6eb766303daf
|
3 |
+
size 498345160
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:27aab49e56804e147eaa43bbe818770428b962547ac289177a97aca89812540b
|
3 |
+
size 498534999
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:cd52b4faab7237a57bde188d102d3b421ed2ec89fb84c7551ea0d9bab2e42a58
|
3 |
+
size 498434419
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:1c1d9ae28052c102e7ab9b1d9f864511d18485ed1bfb04389e6063a382f8e64a
|
3 |
+
size 498412879
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:0491870d606437f8337691d2fc0fdedaa74fb0e55d73ab0e85942a5bb38871fe
|
3 |
+
size 498452682
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:51d8f2f67de934e5c0290c8460359d149eac5da9e4fff72cf40345047e174d7f
|
3 |
+
size 498475473
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:1be5116dfd6751ca93db365ed76414f5be02d4fed1337ee94cf4b4f0da5de13e
|
3 |
+
size 498377033
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:9c900ac6e5f199df446ddd498cb0ff0da2c707eb5f283ac20cad2bfb4ba0e5e0
|
3 |
+
size 498461290
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:825cc046923f47b28b1cdb5379058ce4478e626798101d22b8c0895e26828e91
|
3 |
+
size 498453692
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:977a404e9234ce2cb9783e959d0e306f1da80dd4b058d6738bc01010fe78cdc3
|
3 |
+
size 498462323
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:1a0a341ee2041fa55ce2cf43bfd2d4740e720fab076f00a9c11b9543cb68bf66
|
3 |
+
size 498469001
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:1bf7948bbde83e0b85bf6d518cb2e83cf7cee9bdc74cf604a990c69b6ca4a672
|
3 |
+
size 498401660
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:4720d73d9b3ad6bd3df04a39decbd2808c00003709d5e243e004e45b544e1e51
|
3 |
+
size 498336858
|
@@ -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 = "9241_pegase-nminus1"
|
24 |
-
SIZES = CaseSizes(n_bus=9241, n_load=4895, n_gen=1445, n_branch=16049)
|
25 |
-
NUM_TRAIN = 61158
|
26 |
-
NUM_TEST = 15290
|
27 |
-
NUM_INFEASIBLE = 23552
|
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-Large-9241_pegase-nminus1"
|
33 |
-
DESCRIPTION = """\
|
34 |
-
The 9241_pegase-nminus1 PGLearn optimal power flow dataset, part of the PGLearn-Large 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 and DCOPF 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-Large-9241_pegase-nminus1/blob/script/case.json.gz
|
42 |
-
"""
|
43 |
-
USE_ML4OPF_WARNING = """
|
44 |
-
================================================================================================
|
45 |
-
Loading PGLearn-Large-9241_pegase-nminus1 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-Large-9241_pegase-nminus1#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 PGLearnLarge9241_pegaseNminus1Config(hfd.BuilderConfig):
|
100 |
-
"""BuilderConfig for PGLearn-Large-9241_pegase-nminus1.
|
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(PGLearnLarge9241_pegaseNminus1Config, 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 PGLearnLarge9241_pegaseNminus1(hfd.ArrowBasedBuilder):
|
210 |
-
"""DatasetBuilder for PGLearn-Large-9241_pegase-nminus1.
|
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-Large-9241_pegase-nminus1", 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 = PGLearnLarge9241_pegaseNminus1Config
|
226 |
-
DEFAULT_CONFIG_NAME=CASENAME
|
227 |
-
BUILDER_CONFIGS = [
|
228 |
-
PGLearnLarge9241_pegaseNminus1Config(
|
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: 52889925689
|
290 |
num_examples: 15290
|
291 |
-
download_size:
|
292 |
dataset_size: 264442710202
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
293 |
---
|
|
|
288 |
- name: test
|
289 |
num_bytes: 52889925689
|
290 |
num_examples: 15290
|
291 |
+
download_size: 264578074206
|
292 |
dataset_size: 264442710202
|
293 |
+
configs:
|
294 |
+
- config_name: 9241_pegase-nminus1
|
295 |
+
data_files:
|
296 |
+
- split: train
|
297 |
+
path: 9241_pegase-nminus1/train-*
|
298 |
+
- split: test
|
299 |
+
path: 9241_pegase-nminus1/test-*
|
300 |
+
default: true
|
301 |
---
|
@@ -1,44 +0,0 @@
|
|
1 |
-
# Name of the reference PGLib case. Must be a valid PGLib case name.
|
2 |
-
pglib_case = "pglib_opf_case9241_pegase"
|
3 |
-
floating_point_type = "Float32"
|
4 |
-
|
5 |
-
[sampler]
|
6 |
-
# data sampler options
|
7 |
-
[sampler.load]
|
8 |
-
noise_type = "ScaledUniform"
|
9 |
-
l = 0.6 # Lower bound of base load factor
|
10 |
-
u = 1.0 # Upper bound of base load factor
|
11 |
-
sigma = 0.20 # Relative (multiplicative) noise level.
|
12 |
-
|
13 |
-
[sampler.status]
|
14 |
-
type = "Nminus1"
|
15 |
-
|
16 |
-
[OPF]
|
17 |
-
|
18 |
-
[OPF.ACOPF]
|
19 |
-
type = "ACOPF"
|
20 |
-
solver.name = "Ipopt"
|
21 |
-
solver.attributes.tol = 1e-6
|
22 |
-
solver.attributes.linear_solver = "ma27"
|
23 |
-
|
24 |
-
[OPF.DCOPF]
|
25 |
-
# Formulation/solver options
|
26 |
-
type = "DCOPF"
|
27 |
-
solver.name = "HiGHS"
|
28 |
-
|
29 |
-
[OPF.SOCOPF]
|
30 |
-
type = "SOCOPF"
|
31 |
-
solver.name = "Clarabel"
|
32 |
-
# Tight tolerances
|
33 |
-
solver.attributes.tol_gap_abs = 1e-6
|
34 |
-
solver.attributes.tol_gap_rel = 1e-6
|
35 |
-
solver.attributes.tol_feas = 1e-6
|
36 |
-
solver.attributes.tol_infeas_rel = 1e-6
|
37 |
-
solver.attributes.tol_ktratio = 1e-6
|
38 |
-
# Reduced accuracy settings
|
39 |
-
solver.attributes.reduced_tol_gap_abs = 1e-6
|
40 |
-
solver.attributes.reduced_tol_gap_rel = 1e-6
|
41 |
-
solver.attributes.reduced_tol_feas = 1e-6
|
42 |
-
solver.attributes.reduced_tol_infeas_abs = 1e-6
|
43 |
-
solver.attributes.reduced_tol_infeas_rel = 1e-6
|
44 |
-
solver.attributes.reduced_tol_ktratio = 1e-6
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:5fb5e5d4d972022344347eafcdde76cd7272f2f7994a8cd3532f0ec84f0f0b8d
|
3 |
-
size 16377887993
|
|
|
|
|
|
|
|
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:4fbf0a042c91aa1e08ab42ebfe868822815f3176a6254960125ee78326610ec9
|
3 |
-
size 7310441964
|
|
|
|
|
|
|
|
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:909c02bfa59e86c1879b92916ad1293f260f70b15f0242bdf4669e26e745abbe
|
3 |
-
size 1805860458
|
|
|
|
|
|
|
|
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:ed871b53bf06a8e1e48dba92db78e53565cb8a9f945b4fa0c3509b9dd03ef025
|
3 |
-
size 2003191012
|
|
|
|
|
|
|
|
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:a058e57027de28b6c0c0a6035f2f59180e426bbfd6d2e118eedd29b59896e195
|
3 |
-
size 30283018893
|
|
|
|
|
|
|
|
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:a99aaba2192ed61ddc02c629a689e6fcf039e2cdea52df464679152cb13fa591
|
3 |
-
size 9118006742
|
|
|
|
|
|
|
|
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:a051f9166b2182aac627adc5bf67f9aa0ea473ede38b6805bd8b409444171f9d
|
3 |
-
size 851245839
|
|
|
|
|
|
|
|
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:76a82890d9d90947949b3716ce15bb8b2fc42fe6f3929fc882477e1e7fab4f84
|
3 |
-
size 10438638541
|
|
|
|
|
|
|
|
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:6c1083738a8ce4afa1bf9f6781f579fd901d6576149a56cb09d813a19128b9a4
|
3 |
-
size 520715
|
|
|
|
|
|
|
|
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:b775e5e973bd3a61dc8b004a3383f07cc19c238ff391eb524adbf127c717d9d1
|
3 |
-
size 4725528458
|
|
|
|
|
|
|
|
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:3382196d68a80c817196a1828dee71a6fce6a858e4ba7754a219ce26d1f3ce4a
|
3 |
-
size 1228696414
|
|
|
|
|
|
|
|
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:9cf31a81c26bf556b2474bf8162db6a7a9cad87d5913a04b559fde5f41a14bec
|
3 |
-
size 522917
|
|
|
|
|
|
|
|
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:24acdd69d63498458560857c1199b08cd6c2e434e24286462120693caae15256
|
3 |
-
size 1367332645
|
|
|
|
|
|
|
|
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:eb342bf2df24e8f0cfc7255d566f8f8b7c77fb9f8d98a9aba0afc7302013e296
|
3 |
-
size 19617075908
|
|
|
|
|
|
|
|
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:7ba77e6aa2f00f6a268305fb8e12ee61e905cbcbbef6cfec440c759a24dfe4d2
|
3 |
-
size 521404
|
|
|
|
|
|
|
|
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:fdd944c833ed21455a464c2eecf6a891d5be2576b98a30021418f2dc16e42fc7
|
3 |
-
size 5924466295
|
|
|
|
|
|
|
|
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:596565eae06a826bae5772cb6c3ca876581305b3f0da4ad9eb6f1df1f2a8c32d
|
3 |
-
size 552632885
|
|
|
|
|
|
|
|