Datasets:
Convert dataset to Parquet (part 00001-of-00002) (#2)
Browse files- Convert dataset to Parquet (part 00001-of-00002) (06774b9472e529e7b8c227757cc631b68da28bd6)
- Delete data file (ebb147b3c1f25ceb7918ff02f53a6bea9e2ac012)
- Delete loading script (6e38680ea7bc8dc5cbcfbd2ded4cff4e94ac612f)
- Delete data file (084c110a996550d27b3f2b2b04451e4db934868f)
- Delete data file (1c3b90265cf24c254db483bfa5fc824cc5a49f5c)
- Delete data file (556bdee5452d6db59e9a7a939f168dfe41d81938)
- Delete data file (9f812e30ef2c36f4cb23ee443eb84255173a8ea4)
- Delete data file (cbd73e8e897602de3fe7747d944f629c28353865)
- Delete data file (6e9dbb03e463fcc82d103cb1994bf3a49318e0ea)
- Delete data file (919cc73a2fe17f1d8071b171e2b87ff8396591f3)
- Delete data file (c332402488e8f19bea03e6cb47191f5152ab8401)
- Delete data file (a2e598658b69b5d2e7d8675a531006b8c6e1cfd8)
- Delete data file (b67c271143fbc87153326de3326ca4c7788a8faf)
- Delete data file (eef611474b025d26950d5b45765954a2087b970e)
- Delete data file (2f9fcb5270a5ef4921906659a24ec75a71e5396f)
- Delete data file (e8153844eff4f6cf5f74b41b3331181acddd4034)
- Delete data file (c094f7d5ad2f517ba8041e83f876f4a4fd2efc6f)
- Delete data file (40ab576a094ef33b4f84b741efaa6a66b9a5ce65)
- Delete data file (5a5b02ed4ed6ce48b765f8664e1cdb2501011fee)
- Delete data file (5bc93c7dbc8e79d3e213b41809a59da2b23bf154)
- Delete data file (4405258100a0194ab81b205921e25a6772359e72)
- Delete data file (c6853fb6c7a8eda17f1e02c9579ed83525d69ca6)
- Delete data file (5086cc9a492ce6e8c8f31916081543b7ec2bfa37)
- Delete data file (e4e688ba2fce3121408c815cadc85187ad8e20e7)
- Delete data file (75add605015d8beb9bae4618b762d1da3e235b0e)
- Delete data file (48e8afbee279c2739f2b5454e8d44233113e8901)
- Delete data file (7149bfc42ee12c27064796b59b3022cbcbb18a06)
- Delete data file (431286d7c167bac7e9c6a477d6fd16eee4d479d0)
- Delete data file (4fb1ed67233a8e1e51a9b134ec23fc816c6aba9b)
- Delete data file (7ce2e12d67ceead96641e4120a470c69086461bf)
- Delete data file (bfec7feb718425943e75682c795318a988e03be1)
- Delete data file (2494fa0c25bde978b7411494cd570199252a442d)
- Delete data file (1033d98c5d87384e5c14ca2e7916a9a11e17b234)
- Delete data file (0be9ae180b459ff42e9b04628a2a45e646a15a32)
- infeasible/ACOPF/meta.h5.gz → 300_ieee-nminus1/test-00000-of-00016.parquet +2 -2
- case.json.gz → 300_ieee-nminus1/test-00001-of-00016.parquet +2 -2
- infeasible/ACOPF/primal.h5.gz → 300_ieee-nminus1/test-00002-of-00016.parquet +2 -2
- infeasible/DCOPF/dual.h5.gz → 300_ieee-nminus1/test-00003-of-00016.parquet +2 -2
- 300_ieee-nminus1/test-00004-of-00016.parquet +3 -0
- 300_ieee-nminus1/test-00005-of-00016.parquet +3 -0
- 300_ieee-nminus1/test-00006-of-00016.parquet +3 -0
- 300_ieee-nminus1/test-00007-of-00016.parquet +3 -0
- 300_ieee-nminus1/test-00008-of-00016.parquet +3 -0
- 300_ieee-nminus1/test-00009-of-00016.parquet +3 -0
- 300_ieee-nminus1/test-00010-of-00016.parquet +3 -0
- 300_ieee-nminus1/test-00011-of-00016.parquet +3 -0
- 300_ieee-nminus1/test-00012-of-00016.parquet +3 -0
- 300_ieee-nminus1/test-00013-of-00016.parquet +3 -0
- 300_ieee-nminus1/test-00014-of-00016.parquet +3 -0
- 300_ieee-nminus1/test-00015-of-00016.parquet +3 -0
- 300_ieee-nminus1/train-00050-of-00063.parquet +3 -0
- 300_ieee-nminus1/train-00051-of-00063.parquet +3 -0
- 300_ieee-nminus1/train-00052-of-00063.parquet +3 -0
- 300_ieee-nminus1/train-00053-of-00063.parquet +3 -0
- 300_ieee-nminus1/train-00054-of-00063.parquet +3 -0
- 300_ieee-nminus1/train-00055-of-00063.parquet +3 -0
- 300_ieee-nminus1/train-00056-of-00063.parquet +3 -0
- 300_ieee-nminus1/train-00057-of-00063.parquet +3 -0
- 300_ieee-nminus1/train-00058-of-00063.parquet +3 -0
- 300_ieee-nminus1/train-00059-of-00063.parquet +3 -0
- 300_ieee-nminus1/train-00060-of-00063.parquet +3 -0
- 300_ieee-nminus1/train-00061-of-00063.parquet +3 -0
- 300_ieee-nminus1/train-00062-of-00063.parquet +3 -0
- PGLearn-Small-300_ieee-nminus1.py +0 -427
- README.md +9 -1
- config.toml +0 -44
- infeasible/ACOPF/dual.h5.gz +0 -3
- infeasible/DCOPF/meta.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/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
- train/ACOPF/dual.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:4c07546e04add2c75fe8af653798d4d5c51f82434310aeae74fd524f42a04d5d
|
3 |
+
size 613698269
|
@@ -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:e822df4bdc2a367633545aff7c0c6d5897f2aacd908f5df7aee85180b0beac0f
|
3 |
+
size 613611946
|
@@ -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:bdee9d899e6a5c7cfa8cb54bc6119ffd8dcdb11bf129dd301377de977464fb4c
|
3 |
+
size 613657357
|
@@ -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:58c57c9d52225899422c16f6bd4753d1e277a96a1b677ad3255dbb58866762fc
|
3 |
+
size 613643009
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:c27b969a4da952665afa252b4c78f34e4c227c22a07b35c158805323f5278c91
|
3 |
+
size 613614508
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:703cd844d0e593b5b2d2e01a1ec6d960c9a3cba37f739b8538c670b9e8a4fcd2
|
3 |
+
size 613659289
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:2dd29999c7261a442b7caa9092c21c3c8d65b965e2139f28ce19dd09a10246ca
|
3 |
+
size 613711475
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:2639daaae7143fc3c89b1959a75c77432cb9a3900276180537503149b634dcb8
|
3 |
+
size 613763879
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:72b00d87415a5b6849391980bcc240f24841faa9a1b33e05b0d365532b5b3b9d
|
3 |
+
size 613660973
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:429de12524501cce375300265080b6cb01c948c0ed0a05df43fc612b4e99f8b5
|
3 |
+
size 613432571
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:6a6dfce4633871bcb95a3a0f14fb923bf56addd537dd0e80442e76ee254e587f
|
3 |
+
size 613464908
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:637ec131238d36b0bc2b44e5b5fd5db67a9f5baeb090e203f81d195de982f9f9
|
3 |
+
size 613476377
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:73775178577acd469b1d8e4dba035457c1005153418a4fa335b2ff95033e6605
|
3 |
+
size 613396882
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:4cdfa38a77f3711dc78db1278cd5a8f75f1d132fa1124af615466701e30f6be2
|
3 |
+
size 613599471
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:4000ac044605d2ba94cc929e383b9b562e22cd4b31287df337d7cd50747e9e0f
|
3 |
+
size 613552929
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:9baef68c519ef3be0f2492e3ba186140b26d30455cc5c27c3a897ccd807c46b9
|
3 |
+
size 613457533
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:995c4cd78e65755034e9ed3b93c27b61481eacd7a2a496dd59a8e43d69966626
|
3 |
+
size 624137797
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:a32f07702ad0615a8e4d4c77fc71c155d9fde94cd6f6ee5faf4876bf44bee2d9
|
3 |
+
size 623946133
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:f3bd4c921b72439c31f33d3676dac734c48ee72035a480cb1a49cf079611b398
|
3 |
+
size 624170310
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:3d6997031201c90d881ad1fbdca81c2d7a95bf946e882e5b6f3ab14e2f365cd8
|
3 |
+
size 623957783
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:4b3b19e11585005368431da011ceb9306b46100723ebcf4fa68d8653ba2cf522
|
3 |
+
size 623888359
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:d7aebcea4e3657844519d9596e686415d11fa10fc9fae2e9a9d69465d5f557fe
|
3 |
+
size 624071348
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:6f1c6264682147703fa19f8e9e03c90b8a80f0d790e25f40d95c5a82e1311116
|
3 |
+
size 624012763
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:7e86875e28bf070c37a233b8e4f93b625ce6d27d195c378b282d0feef675d070
|
3 |
+
size 624087756
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:57c06123ae58e518c4eb8de9a0f7cd887bc082228c14d7531aaef22142e3ef39
|
3 |
+
size 623811493
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:847aa5b5c0a402a0b79f9ef9bed645d2f61e1e678c43788d9561a8c833fccf33
|
3 |
+
size 623930712
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:9a7c35a51c10e947c709aad78384d8453a4187a267aaa2bcafd3ae41ec9b6c23
|
3 |
+
size 623887156
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:0accf732cb538236f7c8e2219f59db340ee44327166a6d41c153704009a6feec
|
3 |
+
size 623640294
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:a1b93aaf888ef23b451a824000bb58e73f087ab348d7cfbe71cfecccb8824fc9
|
3 |
+
size 623932377
|
@@ -1,427 +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 = "300_ieee-nminus1"
|
24 |
-
SIZES = CaseSizes(n_bus=300, n_load=201, n_gen=69, n_branch=411)
|
25 |
-
NUM_TRAIN = 336163
|
26 |
-
NUM_TEST = 84041
|
27 |
-
NUM_INFEASIBLE = 79796
|
28 |
-
SPLITFILES = {}
|
29 |
-
|
30 |
-
URL = "https://huggingface.co/datasets/PGLearn/PGLearn-Small-300_ieee-nminus1"
|
31 |
-
DESCRIPTION = """\
|
32 |
-
The 300_ieee-nminus1 PGLearn optimal power flow dataset, part of the PGLearn-Small collection. \
|
33 |
-
"""
|
34 |
-
VERSION = hfd.Version("1.0.0")
|
35 |
-
DEFAULT_CONFIG_DESCRIPTION="""\
|
36 |
-
This configuration contains feasible input, primal solution, and dual solution data \
|
37 |
-
for the ACOPF and DCOPF formulations on the {case} system. For case data, \
|
38 |
-
download the case.json.gz file from the `script` branch of the repository. \
|
39 |
-
https://huggingface.co/datasets/PGLearn/PGLearn-Small-300_ieee-nminus1/blob/script/case.json.gz
|
40 |
-
"""
|
41 |
-
USE_ML4OPF_WARNING = """
|
42 |
-
================================================================================================
|
43 |
-
Loading PGLearn-Small-300_ieee-nminus1 through the `datasets.load_dataset` function may be slow.
|
44 |
-
|
45 |
-
Consider using ML4OPF to directly convert to `torch.Tensor`; for more info see:
|
46 |
-
https://github.com/AI4OPT/ML4OPF?tab=readme-ov-file#manually-loading-data
|
47 |
-
|
48 |
-
Or, use `huggingface_hub.snapshot_download` and an HDF5 reader; for more info see:
|
49 |
-
https://huggingface.co/datasets/PGLearn/PGLearn-Small-300_ieee-nminus1#downloading-individual-files
|
50 |
-
================================================================================================
|
51 |
-
"""
|
52 |
-
CITATION = """\
|
53 |
-
@article{klamkinpglearn,
|
54 |
-
title={{PGLearn - An Open-Source Learning Toolkit for Optimal Power Flow}},
|
55 |
-
author={Klamkin, Michael and Tanneau, Mathieu and Van Hentenryck, Pascal},
|
56 |
-
year={2025},
|
57 |
-
}\
|
58 |
-
"""
|
59 |
-
|
60 |
-
IS_COMPRESSED = True
|
61 |
-
|
62 |
-
# ┌──────────────────┐
|
63 |
-
# │ Formulations │
|
64 |
-
# └──────────────────┘
|
65 |
-
|
66 |
-
def acopf_features(sizes: CaseSizes, primal: bool, dual: bool, meta: bool):
|
67 |
-
features = {}
|
68 |
-
if primal: features.update(acopf_primal_features(sizes))
|
69 |
-
if dual: features.update(acopf_dual_features(sizes))
|
70 |
-
if meta: features.update({f"ACOPF/{k}": v for k, v in META_FEATURES.items()})
|
71 |
-
return features
|
72 |
-
|
73 |
-
def dcopf_features(sizes: CaseSizes, primal: bool, dual: bool, meta: bool):
|
74 |
-
features = {}
|
75 |
-
if primal: features.update(dcopf_primal_features(sizes))
|
76 |
-
if dual: features.update(dcopf_dual_features(sizes))
|
77 |
-
if meta: features.update({f"DCOPF/{k}": v for k, v in META_FEATURES.items()})
|
78 |
-
return features
|
79 |
-
|
80 |
-
def socopf_features(sizes: CaseSizes, primal: bool, dual: bool, meta: bool):
|
81 |
-
features = {}
|
82 |
-
if primal: features.update(socopf_primal_features(sizes))
|
83 |
-
if dual: features.update(socopf_dual_features(sizes))
|
84 |
-
if meta: features.update({f"SOCOPF/{k}": v for k, v in META_FEATURES.items()})
|
85 |
-
return features
|
86 |
-
|
87 |
-
FORMULATIONS_TO_FEATURES = {
|
88 |
-
"ACOPF": acopf_features,
|
89 |
-
"DCOPF": dcopf_features,
|
90 |
-
"SOCOPF": socopf_features,
|
91 |
-
}
|
92 |
-
|
93 |
-
# ┌───────────────────┐
|
94 |
-
# │ BuilderConfig │
|
95 |
-
# └───────────────────┘
|
96 |
-
|
97 |
-
class PGLearnSmall300_ieeeNminus1Config(hfd.BuilderConfig):
|
98 |
-
"""BuilderConfig for PGLearn-Small-300_ieee-nminus1.
|
99 |
-
By default, primal solution data, metadata, input, casejson, are included for the train and test splits.
|
100 |
-
|
101 |
-
To modify the default configuration, pass attributes of this class to `datasets.load_dataset`:
|
102 |
-
|
103 |
-
Attributes:
|
104 |
-
formulations (list[str]): The formulation(s) to include, e.g. ["ACOPF", "DCOPF"]
|
105 |
-
primal (bool, optional): Include primal solution data. Defaults to True.
|
106 |
-
dual (bool, optional): Include dual solution data. Defaults to False.
|
107 |
-
meta (bool, optional): Include metadata. Defaults to True.
|
108 |
-
input (bool, optional): Include input data. Defaults to True.
|
109 |
-
casejson (bool, optional): Include case.json data. Defaults to True.
|
110 |
-
train (bool, optional): Include training samples. Defaults to True.
|
111 |
-
test (bool, optional): Include testing samples. Defaults to True.
|
112 |
-
infeasible (bool, optional): Include infeasible samples. Defaults to False.
|
113 |
-
"""
|
114 |
-
def __init__(self,
|
115 |
-
formulations: list[str],
|
116 |
-
primal: bool=True, dual: bool=False, meta: bool=True, input: bool = True, casejson: bool=True,
|
117 |
-
train: bool=True, test: bool=True, infeasible: bool=False,
|
118 |
-
compressed: bool=IS_COMPRESSED, **kwargs
|
119 |
-
):
|
120 |
-
super(PGLearnSmall300_ieeeNminus1Config, self).__init__(version=VERSION, **kwargs)
|
121 |
-
|
122 |
-
self.case = CASENAME
|
123 |
-
self.formulations = formulations
|
124 |
-
|
125 |
-
self.primal = primal
|
126 |
-
self.dual = dual
|
127 |
-
self.meta = meta
|
128 |
-
self.input = input
|
129 |
-
self.casejson = casejson
|
130 |
-
|
131 |
-
self.train = train
|
132 |
-
self.test = test
|
133 |
-
self.infeasible = infeasible
|
134 |
-
|
135 |
-
self.gz_ext = ".gz" if compressed else ""
|
136 |
-
|
137 |
-
@property
|
138 |
-
def size(self):
|
139 |
-
return SIZES
|
140 |
-
|
141 |
-
@property
|
142 |
-
def features(self):
|
143 |
-
features = {}
|
144 |
-
if self.casejson: features.update(case_features())
|
145 |
-
if self.input: features.update(input_features(SIZES))
|
146 |
-
for formulation in self.formulations:
|
147 |
-
features.update(FORMULATIONS_TO_FEATURES[formulation](SIZES, self.primal, self.dual, self.meta))
|
148 |
-
return hfd.Features(features)
|
149 |
-
|
150 |
-
@property
|
151 |
-
def splits(self):
|
152 |
-
splits: dict[hfd.Split, dict[str, str | int]] = {}
|
153 |
-
if self.train:
|
154 |
-
splits[hfd.Split.TRAIN] = {
|
155 |
-
"name": "train",
|
156 |
-
"num_examples": NUM_TRAIN
|
157 |
-
}
|
158 |
-
if self.test:
|
159 |
-
splits[hfd.Split.TEST] = {
|
160 |
-
"name": "test",
|
161 |
-
"num_examples": NUM_TEST
|
162 |
-
}
|
163 |
-
if self.infeasible:
|
164 |
-
splits[hfd.Split("infeasible")] = {
|
165 |
-
"name": "infeasible",
|
166 |
-
"num_examples": NUM_INFEASIBLE
|
167 |
-
}
|
168 |
-
return splits
|
169 |
-
|
170 |
-
@property
|
171 |
-
def urls(self):
|
172 |
-
urls: dict[str, None | str | list] = {
|
173 |
-
"case": None, "train": [], "test": [], "infeasible": [],
|
174 |
-
}
|
175 |
-
|
176 |
-
if self.casejson:
|
177 |
-
urls["case"] = f"case.json" + self.gz_ext
|
178 |
-
else:
|
179 |
-
urls.pop("case")
|
180 |
-
|
181 |
-
split_names = []
|
182 |
-
if self.train: split_names.append("train")
|
183 |
-
if self.test: split_names.append("test")
|
184 |
-
if self.infeasible: split_names.append("infeasible")
|
185 |
-
|
186 |
-
for split in split_names:
|
187 |
-
if self.input: urls[split].append(f"{split}/input.h5" + self.gz_ext)
|
188 |
-
for formulation in self.formulations:
|
189 |
-
if self.primal:
|
190 |
-
filename = f"{split}/{formulation}/primal.h5" + self.gz_ext
|
191 |
-
if filename in SPLITFILES: urls[split].append(SPLITFILES[filename])
|
192 |
-
else: urls[split].append(filename)
|
193 |
-
if self.dual:
|
194 |
-
filename = f"{split}/{formulation}/dual.h5" + self.gz_ext
|
195 |
-
if filename in SPLITFILES: urls[split].append(SPLITFILES[filename])
|
196 |
-
else: urls[split].append(filename)
|
197 |
-
if self.meta:
|
198 |
-
filename = f"{split}/{formulation}/meta.h5" + self.gz_ext
|
199 |
-
if filename in SPLITFILES: urls[split].append(SPLITFILES[filename])
|
200 |
-
else: urls[split].append(filename)
|
201 |
-
return urls
|
202 |
-
|
203 |
-
# ┌────────────────────┐
|
204 |
-
# │ DatasetBuilder │
|
205 |
-
# └────────────────────┘
|
206 |
-
|
207 |
-
class PGLearnSmall300_ieeeNminus1(hfd.ArrowBasedBuilder):
|
208 |
-
"""DatasetBuilder for PGLearn-Small-300_ieee-nminus1.
|
209 |
-
The main interface is `datasets.load_dataset` with `trust_remote_code=True`, e.g.
|
210 |
-
|
211 |
-
```python
|
212 |
-
from datasets import load_dataset
|
213 |
-
ds = load_dataset("PGLearn/PGLearn-Small-300_ieee-nminus1", trust_remote_code=True,
|
214 |
-
# modify the default configuration by passing kwargs
|
215 |
-
formulations=["DCOPF"],
|
216 |
-
dual=False,
|
217 |
-
meta=False,
|
218 |
-
)
|
219 |
-
```
|
220 |
-
"""
|
221 |
-
|
222 |
-
DEFAULT_WRITER_BATCH_SIZE = 10000
|
223 |
-
BUILDER_CONFIG_CLASS = PGLearnSmall300_ieeeNminus1Config
|
224 |
-
DEFAULT_CONFIG_NAME=CASENAME
|
225 |
-
BUILDER_CONFIGS = [
|
226 |
-
PGLearnSmall300_ieeeNminus1Config(
|
227 |
-
name=CASENAME, description=DEFAULT_CONFIG_DESCRIPTION.format(case=CASENAME),
|
228 |
-
formulations=list(FORMULATIONS_TO_FEATURES.keys()),
|
229 |
-
primal=True, dual=True, meta=True, input=True, casejson=False,
|
230 |
-
train=True, test=True, infeasible=False,
|
231 |
-
)
|
232 |
-
]
|
233 |
-
|
234 |
-
def _info(self):
|
235 |
-
return hfd.DatasetInfo(
|
236 |
-
features=self.config.features, splits=self.config.splits,
|
237 |
-
description=DESCRIPTION + self.config.description,
|
238 |
-
homepage=URL, citation=CITATION,
|
239 |
-
)
|
240 |
-
|
241 |
-
def _split_generators(self, dl_manager: hfd.DownloadManager):
|
242 |
-
hfd.logging.get_logger().warning(USE_ML4OPF_WARNING)
|
243 |
-
|
244 |
-
filepaths = dl_manager.download_and_extract(self.config.urls)
|
245 |
-
|
246 |
-
splits: list[hfd.SplitGenerator] = []
|
247 |
-
if self.config.train:
|
248 |
-
splits.append(hfd.SplitGenerator(
|
249 |
-
name=hfd.Split.TRAIN,
|
250 |
-
gen_kwargs=dict(case_file=filepaths.get("case", None), data_files=tuple(filepaths["train"]), n_samples=NUM_TRAIN),
|
251 |
-
))
|
252 |
-
if self.config.test:
|
253 |
-
splits.append(hfd.SplitGenerator(
|
254 |
-
name=hfd.Split.TEST,
|
255 |
-
gen_kwargs=dict(case_file=filepaths.get("case", None), data_files=tuple(filepaths["test"]), n_samples=NUM_TEST),
|
256 |
-
))
|
257 |
-
if self.config.infeasible:
|
258 |
-
splits.append(hfd.SplitGenerator(
|
259 |
-
name=hfd.Split("infeasible"),
|
260 |
-
gen_kwargs=dict(case_file=filepaths.get("case", None), data_files=tuple(filepaths["infeasible"]), n_samples=NUM_INFEASIBLE),
|
261 |
-
))
|
262 |
-
return splits
|
263 |
-
|
264 |
-
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):
|
265 |
-
case_data: str | None = json.dumps(json.load(open_maybe_gzip_cat(case_file))) if case_file is not None else None
|
266 |
-
data: dict[str, h5py.File] = {}
|
267 |
-
for file in data_files:
|
268 |
-
v = h5py.File(open_maybe_gzip_cat(file), "r")
|
269 |
-
if isinstance(file, list):
|
270 |
-
k = "/".join(Path(file[0].get_origin()).parts[-3:-1]).split(".")[0]
|
271 |
-
else:
|
272 |
-
k = "/".join(Path(file.get_origin()).parts[-2:]).split(".")[0]
|
273 |
-
data[k] = v
|
274 |
-
for k in list(data.keys()):
|
275 |
-
if "/input" in k: data[k.split("/", 1)[1]] = data.pop(k)
|
276 |
-
|
277 |
-
batch_size = self._writer_batch_size or self.DEFAULT_WRITER_BATCH_SIZE
|
278 |
-
for i in range(0, n_samples, batch_size):
|
279 |
-
effective_batch_size = min(batch_size, n_samples - i)
|
280 |
-
|
281 |
-
sample_data = {
|
282 |
-
f"{dk}/{k}":
|
283 |
-
hfd.features.features.numpy_to_pyarrow_listarray(v[i:i + effective_batch_size, ...])
|
284 |
-
for dk, d in data.items() for k, v in d.items() if f"{dk}/{k}" in self.config.features
|
285 |
-
}
|
286 |
-
|
287 |
-
if case_data is not None:
|
288 |
-
sample_data["case/json"] = pa.array([case_data] * effective_batch_size)
|
289 |
-
|
290 |
-
yield i, pa.Table.from_pydict(sample_data)
|
291 |
-
|
292 |
-
for f in data.values():
|
293 |
-
f.close()
|
294 |
-
|
295 |
-
# ┌──────────────┐
|
296 |
-
# │ Features │
|
297 |
-
# └──────────────┘
|
298 |
-
|
299 |
-
FLOAT_TYPE = "float32"
|
300 |
-
INT_TYPE = "int64"
|
301 |
-
BOOL_TYPE = "bool"
|
302 |
-
STRING_TYPE = "string"
|
303 |
-
|
304 |
-
def case_features():
|
305 |
-
# FIXME: better way to share schema of case data -- need to treat jagged arrays
|
306 |
-
return {
|
307 |
-
"case/json": hfd.Value(STRING_TYPE),
|
308 |
-
}
|
309 |
-
|
310 |
-
META_FEATURES = {
|
311 |
-
"meta/seed": hfd.Value(dtype=INT_TYPE),
|
312 |
-
"meta/formulation": hfd.Value(dtype=STRING_TYPE),
|
313 |
-
"meta/primal_objective_value": hfd.Value(dtype=FLOAT_TYPE),
|
314 |
-
"meta/dual_objective_value": hfd.Value(dtype=FLOAT_TYPE),
|
315 |
-
"meta/primal_status": hfd.Value(dtype=STRING_TYPE),
|
316 |
-
"meta/dual_status": hfd.Value(dtype=STRING_TYPE),
|
317 |
-
"meta/termination_status": hfd.Value(dtype=STRING_TYPE),
|
318 |
-
"meta/build_time": hfd.Value(dtype=FLOAT_TYPE),
|
319 |
-
"meta/extract_time": hfd.Value(dtype=FLOAT_TYPE),
|
320 |
-
"meta/solve_time": hfd.Value(dtype=FLOAT_TYPE),
|
321 |
-
}
|
322 |
-
|
323 |
-
def input_features(sizes: CaseSizes):
|
324 |
-
return {
|
325 |
-
"input/pd": hfd.Sequence(length=sizes.n_load, feature=hfd.Value(dtype=FLOAT_TYPE)),
|
326 |
-
"input/qd": hfd.Sequence(length=sizes.n_load, feature=hfd.Value(dtype=FLOAT_TYPE)),
|
327 |
-
"input/gen_status": hfd.Sequence(length=sizes.n_gen, feature=hfd.Value(dtype=BOOL_TYPE)),
|
328 |
-
"input/branch_status": hfd.Sequence(length=sizes.n_branch, feature=hfd.Value(dtype=BOOL_TYPE)),
|
329 |
-
"input/seed": hfd.Value(dtype=INT_TYPE),
|
330 |
-
}
|
331 |
-
|
332 |
-
def acopf_primal_features(sizes: CaseSizes):
|
333 |
-
return {
|
334 |
-
"ACOPF/primal/vm": hfd.Sequence(length=sizes.n_bus, feature=hfd.Value(dtype=FLOAT_TYPE)),
|
335 |
-
"ACOPF/primal/va": hfd.Sequence(length=sizes.n_bus, feature=hfd.Value(dtype=FLOAT_TYPE)),
|
336 |
-
"ACOPF/primal/pg": hfd.Sequence(length=sizes.n_gen, feature=hfd.Value(dtype=FLOAT_TYPE)),
|
337 |
-
"ACOPF/primal/qg": hfd.Sequence(length=sizes.n_gen, feature=hfd.Value(dtype=FLOAT_TYPE)),
|
338 |
-
"ACOPF/primal/pf": hfd.Sequence(length=sizes.n_branch, feature=hfd.Value(dtype=FLOAT_TYPE)),
|
339 |
-
"ACOPF/primal/pt": hfd.Sequence(length=sizes.n_branch, feature=hfd.Value(dtype=FLOAT_TYPE)),
|
340 |
-
"ACOPF/primal/qf": hfd.Sequence(length=sizes.n_branch, feature=hfd.Value(dtype=FLOAT_TYPE)),
|
341 |
-
"ACOPF/primal/qt": hfd.Sequence(length=sizes.n_branch, feature=hfd.Value(dtype=FLOAT_TYPE)),
|
342 |
-
}
|
343 |
-
def acopf_dual_features(sizes: CaseSizes):
|
344 |
-
return {
|
345 |
-
"ACOPF/dual/kcl_p": hfd.Sequence(length=sizes.n_bus, feature=hfd.Value(dtype=FLOAT_TYPE)),
|
346 |
-
"ACOPF/dual/kcl_q": hfd.Sequence(length=sizes.n_bus, feature=hfd.Value(dtype=FLOAT_TYPE)),
|
347 |
-
"ACOPF/dual/vm": hfd.Sequence(length=sizes.n_bus, feature=hfd.Value(dtype=FLOAT_TYPE)),
|
348 |
-
"ACOPF/dual/pg": hfd.Sequence(length=sizes.n_gen, feature=hfd.Value(dtype=FLOAT_TYPE)),
|
349 |
-
"ACOPF/dual/qg": hfd.Sequence(length=sizes.n_gen, feature=hfd.Value(dtype=FLOAT_TYPE)),
|
350 |
-
"ACOPF/dual/ohm_pf": hfd.Sequence(length=sizes.n_branch, feature=hfd.Value(dtype=FLOAT_TYPE)),
|
351 |
-
"ACOPF/dual/ohm_pt": hfd.Sequence(length=sizes.n_branch, feature=hfd.Value(dtype=FLOAT_TYPE)),
|
352 |
-
"ACOPF/dual/ohm_qf": hfd.Sequence(length=sizes.n_branch, feature=hfd.Value(dtype=FLOAT_TYPE)),
|
353 |
-
"ACOPF/dual/ohm_qt": hfd.Sequence(length=sizes.n_branch, feature=hfd.Value(dtype=FLOAT_TYPE)),
|
354 |
-
"ACOPF/dual/pf": hfd.Sequence(length=sizes.n_branch, feature=hfd.Value(dtype=FLOAT_TYPE)),
|
355 |
-
"ACOPF/dual/pt": hfd.Sequence(length=sizes.n_branch, feature=hfd.Value(dtype=FLOAT_TYPE)),
|
356 |
-
"ACOPF/dual/qf": hfd.Sequence(length=sizes.n_branch, feature=hfd.Value(dtype=FLOAT_TYPE)),
|
357 |
-
"ACOPF/dual/qt": hfd.Sequence(length=sizes.n_branch, feature=hfd.Value(dtype=FLOAT_TYPE)),
|
358 |
-
"ACOPF/dual/va_diff": hfd.Sequence(length=sizes.n_branch, feature=hfd.Value(dtype=FLOAT_TYPE)),
|
359 |
-
"ACOPF/dual/sm_fr": hfd.Sequence(length=sizes.n_branch, feature=hfd.Value(dtype=FLOAT_TYPE)),
|
360 |
-
"ACOPF/dual/sm_to": hfd.Sequence(length=sizes.n_branch, feature=hfd.Value(dtype=FLOAT_TYPE)),
|
361 |
-
"ACOPF/dual/slack_bus": hfd.Value(dtype=FLOAT_TYPE),
|
362 |
-
}
|
363 |
-
def dcopf_primal_features(sizes: CaseSizes):
|
364 |
-
return {
|
365 |
-
"DCOPF/primal/va": hfd.Sequence(length=sizes.n_bus, feature=hfd.Value(dtype=FLOAT_TYPE)),
|
366 |
-
"DCOPF/primal/pg": hfd.Sequence(length=sizes.n_gen, feature=hfd.Value(dtype=FLOAT_TYPE)),
|
367 |
-
"DCOPF/primal/pf": hfd.Sequence(length=sizes.n_branch, feature=hfd.Value(dtype=FLOAT_TYPE)),
|
368 |
-
}
|
369 |
-
def dcopf_dual_features(sizes: CaseSizes):
|
370 |
-
return {
|
371 |
-
"DCOPF/dual/kcl_p": hfd.Sequence(length=sizes.n_bus, feature=hfd.Value(dtype=FLOAT_TYPE)),
|
372 |
-
"DCOPF/dual/pg": hfd.Sequence(length=sizes.n_gen, feature=hfd.Value(dtype=FLOAT_TYPE)),
|
373 |
-
"DCOPF/dual/ohm_pf": hfd.Sequence(length=sizes.n_branch, feature=hfd.Value(dtype=FLOAT_TYPE)),
|
374 |
-
"DCOPF/dual/pf": hfd.Sequence(length=sizes.n_branch, feature=hfd.Value(dtype=FLOAT_TYPE)),
|
375 |
-
"DCOPF/dual/va_diff": hfd.Sequence(length=sizes.n_branch, feature=hfd.Value(dtype=FLOAT_TYPE)),
|
376 |
-
"DCOPF/dual/slack_bus": hfd.Value(dtype=FLOAT_TYPE),
|
377 |
-
}
|
378 |
-
def socopf_primal_features(sizes: CaseSizes):
|
379 |
-
return {
|
380 |
-
"SOCOPF/primal/w": hfd.Sequence(length=sizes.n_bus, feature=hfd.Value(dtype=FLOAT_TYPE)),
|
381 |
-
"SOCOPF/primal/pg": hfd.Sequence(length=sizes.n_gen, feature=hfd.Value(dtype=FLOAT_TYPE)),
|
382 |
-
"SOCOPF/primal/qg": hfd.Sequence(length=sizes.n_gen, feature=hfd.Value(dtype=FLOAT_TYPE)),
|
383 |
-
"SOCOPF/primal/pf": hfd.Sequence(length=sizes.n_branch, feature=hfd.Value(dtype=FLOAT_TYPE)),
|
384 |
-
"SOCOPF/primal/pt": hfd.Sequence(length=sizes.n_branch, feature=hfd.Value(dtype=FLOAT_TYPE)),
|
385 |
-
"SOCOPF/primal/qf": hfd.Sequence(length=sizes.n_branch, feature=hfd.Value(dtype=FLOAT_TYPE)),
|
386 |
-
"SOCOPF/primal/qt": hfd.Sequence(length=sizes.n_branch, feature=hfd.Value(dtype=FLOAT_TYPE)),
|
387 |
-
"SOCOPF/primal/wr": hfd.Sequence(length=sizes.n_branch, feature=hfd.Value(dtype=FLOAT_TYPE)),
|
388 |
-
"SOCOPF/primal/wi": hfd.Sequence(length=sizes.n_branch, feature=hfd.Value(dtype=FLOAT_TYPE)),
|
389 |
-
}
|
390 |
-
def socopf_dual_features(sizes: CaseSizes):
|
391 |
-
return {
|
392 |
-
"SOCOPF/dual/kcl_p": hfd.Sequence(length=sizes.n_bus, feature=hfd.Value(dtype=FLOAT_TYPE)),
|
393 |
-
"SOCOPF/dual/kcl_q": hfd.Sequence(length=sizes.n_bus, feature=hfd.Value(dtype=FLOAT_TYPE)),
|
394 |
-
"SOCOPF/dual/w": hfd.Sequence(length=sizes.n_bus, feature=hfd.Value(dtype=FLOAT_TYPE)),
|
395 |
-
"SOCOPF/dual/pg": hfd.Sequence(length=sizes.n_gen, feature=hfd.Value(dtype=FLOAT_TYPE)),
|
396 |
-
"SOCOPF/dual/qg": hfd.Sequence(length=sizes.n_gen, feature=hfd.Value(dtype=FLOAT_TYPE)),
|
397 |
-
"SOCOPF/dual/ohm_pf": hfd.Sequence(length=sizes.n_branch, feature=hfd.Value(dtype=FLOAT_TYPE)),
|
398 |
-
"SOCOPF/dual/ohm_pt": hfd.Sequence(length=sizes.n_branch, feature=hfd.Value(dtype=FLOAT_TYPE)),
|
399 |
-
"SOCOPF/dual/ohm_qf": hfd.Sequence(length=sizes.n_branch, feature=hfd.Value(dtype=FLOAT_TYPE)),
|
400 |
-
"SOCOPF/dual/ohm_qt": hfd.Sequence(length=sizes.n_branch, feature=hfd.Value(dtype=FLOAT_TYPE)),
|
401 |
-
"SOCOPF/dual/jabr": hfd.Array2D(shape=(sizes.n_branch, 4), dtype=FLOAT_TYPE),
|
402 |
-
"SOCOPF/dual/sm_fr": hfd.Array2D(shape=(sizes.n_branch, 3), dtype=FLOAT_TYPE),
|
403 |
-
"SOCOPF/dual/sm_to": hfd.Array2D(shape=(sizes.n_branch, 3), dtype=FLOAT_TYPE),
|
404 |
-
"SOCOPF/dual/va_diff": hfd.Sequence(length=sizes.n_branch, feature=hfd.Value(dtype=FLOAT_TYPE)),
|
405 |
-
"SOCOPF/dual/wr": hfd.Sequence(length=sizes.n_branch, feature=hfd.Value(dtype=FLOAT_TYPE)),
|
406 |
-
"SOCOPF/dual/wi": hfd.Sequence(length=sizes.n_branch, feature=hfd.Value(dtype=FLOAT_TYPE)),
|
407 |
-
"SOCOPF/dual/pf": hfd.Sequence(length=sizes.n_branch, feature=hfd.Value(dtype=FLOAT_TYPE)),
|
408 |
-
"SOCOPF/dual/pt": hfd.Sequence(length=sizes.n_branch, feature=hfd.Value(dtype=FLOAT_TYPE)),
|
409 |
-
"SOCOPF/dual/qf": hfd.Sequence(length=sizes.n_branch, feature=hfd.Value(dtype=FLOAT_TYPE)),
|
410 |
-
"SOCOPF/dual/qt": hfd.Sequence(length=sizes.n_branch, feature=hfd.Value(dtype=FLOAT_TYPE)),
|
411 |
-
}
|
412 |
-
|
413 |
-
# ┌──────���────────┐
|
414 |
-
# │ Utilities │
|
415 |
-
# └───────────────┘
|
416 |
-
|
417 |
-
def open_maybe_gzip_cat(path: str | list):
|
418 |
-
if isinstance(path, list):
|
419 |
-
dest = Path(path[0]).parent.with_suffix(".h5")
|
420 |
-
if not dest.exists():
|
421 |
-
with open(dest, "wb") as dest_f:
|
422 |
-
for piece in path:
|
423 |
-
with open(piece, "rb") as piece_f:
|
424 |
-
shutil.copyfileobj(piece_f, dest_f)
|
425 |
-
shutil.rmtree(Path(piece).parent)
|
426 |
-
path = dest.as_posix()
|
427 |
-
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: 7866573765
|
290 |
num_examples: 84041
|
291 |
-
download_size:
|
292 |
dataset_size: 39332775218
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
293 |
---
|
|
|
288 |
- name: test
|
289 |
num_bytes: 7866573765
|
290 |
num_examples: 84041
|
291 |
+
download_size: 49128070826
|
292 |
dataset_size: 39332775218
|
293 |
+
configs:
|
294 |
+
- config_name: 300_ieee-nminus1
|
295 |
+
data_files:
|
296 |
+
- split: train
|
297 |
+
path: 300_ieee-nminus1/train-*
|
298 |
+
- split: test
|
299 |
+
path: 300_ieee-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_case300_ieee"
|
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:7ea4006d589a16e863ca955290d697b0d5ccd07356a9c665bdc25fe7ee8f6ab7
|
3 |
-
size 1680156274
|
|
|
|
|
|
|
|
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:c4fabe2236ba542df1ca59c3414e3027d193084127d10bb2aa609f027d3087d8
|
3 |
-
size 2660298
|
|
|
|
|
|
|
|
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:7e1688c9cf6b617dabd7b191766fac63db51c05a819320ad1a2e1cf666743378
|
3 |
-
size 160142390
|
|
|
|
|
|
|
|
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:7305ddd60c600b2f8a31a1d7acb640baff06440c2d0584249d04b5a2cea0887c
|
3 |
-
size 2910643104
|
|
|
|
|
|
|
|
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:90f6950fc345a3fc92a78e2e8ad3ee93bafe1dcaaf4e71ee76ad58d25f768fb1
|
3 |
-
size 2673139
|
|
|
|
|
|
|
|
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:4e46df6889f4a582b1adb9de286eec37e258d4d9cfb6ead50fb546fd24f4c58a
|
3 |
-
size 218420166
|
|
|
|
|
|
|
|
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:0246fe4cc6f82bad684ca6502e878875b30f7e9ece42fcab84c8ebddadc9a92c
|
3 |
-
size 112459534
|
|
|
|
|
|
|
|
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:5a8e43c16a18a3eea22ed3e66bf0e07365cedd1ecffac7889f754f6f8037af76
|
3 |
-
size 1597597821
|
|
|
|
|
|
|
|
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:a929dc1bfb893573c9b1d091eba52ff082d6c2f961ad45e1e68b9b629ac8e474
|
3 |
-
size 2821461
|
|
|
|
|
|
|
|
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:96b2a37a266c12919845acbdefe2cfa56c3c42438a202ccb12426467e3206c91
|
3 |
-
size 709113030
|
|
|
|
|
|
|
|
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:586a829bcbe56731df996d31d603c4ede9b2a6501f94447949e65f17b2343670
|
3 |
-
size 154296656
|
|
|
|
|
|
|
|
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:a6d1da830878a09cbae2264bb8f22635627c8d35861540b60adfd5982bcdb1b4
|
3 |
-
size 2726057
|
|
|
|
|
|
|
|
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:07eb225d5db27f112b5e4b2fe5eb2d914454f5b55ecd28ed3b37883e521ac231
|
3 |
-
size 213126077
|
|
|
|
|
|
|
|
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:796aa6afc6d70d42575a82b93a6e6f3c93b61ac4095dd281ade83d1591e27c30
|
3 |
-
size 2926168177
|
|
|
|
|
|
|
|
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:fa90992247980d3ec079314407b937bc8b7dee6b2d638e6e8046ae37e5c3af93
|
3 |
-
size 2845435
|
|
|
|
|
|
|
|
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:0f2278d4e474ebec9a7c0fb4e74469ed2446285e39ddff4710d5b62d29a48588
|
3 |
-
size 866734008
|
|
|
|
|
|
|
|
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:b08842534fb513a89422036705b0fdc7766d6881aeb4b90dde3731070f311c8f
|
3 |
-
size 118488044
|
|
|
|
|
|
|
|
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:d03262e7e4cbe56f53eaacc32e34709f21a2b7ecb0d22b4bba0a1538e8d177f2
|
3 |
-
size 6390290481
|
|
|
|
|
|
|
|