klamike commited on
Commit
f2d4067
·
verified ·
1 Parent(s): b9994da

Convert dataset to Parquet (part 00007-of-00008) (#8)

Browse files

- Convert dataset to Parquet (part 00007-of-00008) (b164a70d68b8bb00eb6294f6a232c17b67119bc6)
- Delete loading script (3964e2a31c4b285389986c559e0de7ee1ea8f12b)

Files changed (46) hide show
  1. 1354_pegase/test-00035-of-00079.parquet +3 -0
  2. 1354_pegase/test-00036-of-00079.parquet +3 -0
  3. 1354_pegase/test-00037-of-00079.parquet +3 -0
  4. 1354_pegase/test-00038-of-00079.parquet +3 -0
  5. 1354_pegase/test-00039-of-00079.parquet +3 -0
  6. 1354_pegase/test-00040-of-00079.parquet +3 -0
  7. 1354_pegase/test-00041-of-00079.parquet +3 -0
  8. 1354_pegase/test-00042-of-00079.parquet +3 -0
  9. 1354_pegase/test-00043-of-00079.parquet +3 -0
  10. 1354_pegase/test-00044-of-00079.parquet +3 -0
  11. 1354_pegase/test-00045-of-00079.parquet +3 -0
  12. 1354_pegase/test-00046-of-00079.parquet +3 -0
  13. 1354_pegase/test-00047-of-00079.parquet +3 -0
  14. 1354_pegase/test-00048-of-00079.parquet +3 -0
  15. 1354_pegase/test-00049-of-00079.parquet +3 -0
  16. 1354_pegase/test-00050-of-00079.parquet +3 -0
  17. 1354_pegase/test-00051-of-00079.parquet +3 -0
  18. 1354_pegase/test-00052-of-00079.parquet +3 -0
  19. 1354_pegase/test-00053-of-00079.parquet +3 -0
  20. 1354_pegase/test-00054-of-00079.parquet +3 -0
  21. 1354_pegase/test-00055-of-00079.parquet +3 -0
  22. 1354_pegase/test-00056-of-00079.parquet +3 -0
  23. 1354_pegase/test-00057-of-00079.parquet +3 -0
  24. 1354_pegase/test-00058-of-00079.parquet +3 -0
  25. 1354_pegase/test-00059-of-00079.parquet +3 -0
  26. 1354_pegase/test-00060-of-00079.parquet +3 -0
  27. 1354_pegase/test-00061-of-00079.parquet +3 -0
  28. 1354_pegase/test-00062-of-00079.parquet +3 -0
  29. 1354_pegase/test-00063-of-00079.parquet +3 -0
  30. 1354_pegase/test-00064-of-00079.parquet +3 -0
  31. 1354_pegase/test-00065-of-00079.parquet +3 -0
  32. 1354_pegase/test-00066-of-00079.parquet +3 -0
  33. 1354_pegase/test-00067-of-00079.parquet +3 -0
  34. 1354_pegase/test-00068-of-00079.parquet +3 -0
  35. 1354_pegase/test-00069-of-00079.parquet +3 -0
  36. 1354_pegase/test-00070-of-00079.parquet +3 -0
  37. 1354_pegase/test-00071-of-00079.parquet +3 -0
  38. 1354_pegase/test-00072-of-00079.parquet +3 -0
  39. 1354_pegase/test-00073-of-00079.parquet +3 -0
  40. 1354_pegase/test-00074-of-00079.parquet +3 -0
  41. 1354_pegase/test-00075-of-00079.parquet +3 -0
  42. 1354_pegase/test-00076-of-00079.parquet +3 -0
  43. 1354_pegase/test-00077-of-00079.parquet +3 -0
  44. 1354_pegase/test-00078-of-00079.parquet +3 -0
  45. PGLearn-Medium-1354_pegase.py +0 -429
  46. README.md +292 -0
1354_pegase/test-00035-of-00079.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c0d30fd9f48836eed4a18b358b3a6def7931d05e3a42ef5a4361db3cfc8ecf0f
3
+ size 515371314
1354_pegase/test-00036-of-00079.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:51d60290911f0625663883f83a8c3f165aafe3c16294c22469744b16b668455c
3
+ size 515246510
1354_pegase/test-00037-of-00079.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:015424c1d17a3e546e8b40cb5216da4357963337c11f3b70d74472a07ea202a8
3
+ size 515191735
1354_pegase/test-00038-of-00079.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:139ffb82d394a11d6a18951d42b2825876c2dffe23133fedbd9521e9c9dcb590
3
+ size 515128893
1354_pegase/test-00039-of-00079.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4eb5cedb2e36a69045bd7e6789a6d6a6372e313e8b95f2626e9c33bf6521d960
3
+ size 515053360
1354_pegase/test-00040-of-00079.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:db771072732beb382559ddeb657975feb7c8513a5c6641c32481b4a3b5f2b77c
3
+ size 515156618
1354_pegase/test-00041-of-00079.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b16862adbcfde57593df642b13ac515f9be56456cb8cc1f27ada37a9a871f3e8
3
+ size 515248539
1354_pegase/test-00042-of-00079.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8495680f5ed63f371d28bcf202c35aa5d24552ae6ff99904748e72479d8247ab
3
+ size 515104333
1354_pegase/test-00043-of-00079.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:97da3436f84fd99bcd5b88d68ead623f33626e5f52b4023c4e88c432fa617105
3
+ size 515260787
1354_pegase/test-00044-of-00079.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a0c1ccaa740ffe4b8a8d499cd5c41e8f179a800fd635dc20795a8c7fab4e3fe1
3
+ size 515273076
1354_pegase/test-00045-of-00079.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:868518e86d9e8256bda8bb4d954950666d88af13e059285b24aace49f19c41e4
3
+ size 515160072
1354_pegase/test-00046-of-00079.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:78481736b86c75bfc4601322c2d9cf3a9267cad167d1672e0307819d06357317
3
+ size 515351205
1354_pegase/test-00047-of-00079.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8dd6e59e82e16e2da37a14f42c2017a53da816e8b73b9032f1a0b60cec65a6b2
3
+ size 515237781
1354_pegase/test-00048-of-00079.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d45af06cf76919fe97bd3e8ea635fb108bb7b565bf9459d1a91294be73f92539
3
+ size 515320473
1354_pegase/test-00049-of-00079.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3b47077dcb3433789bc53faea185a31850511158e22442eb461085e74a49ba1a
3
+ size 515212002
1354_pegase/test-00050-of-00079.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fc32c918892d94f1480174c38a076ead5ea81bf2089a2c1a92cfaf754ef695ba
3
+ size 515193159
1354_pegase/test-00051-of-00079.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:379009bddd00927bcd0ae73fe4a0becff3e191f5df573ea7b089f2c8e9ba90b4
3
+ size 515350298
1354_pegase/test-00052-of-00079.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b3c602e74e786bec0cb602e184d62b4d3ad441bab9dd07593bbec8a8ebde60fe
3
+ size 515349389
1354_pegase/test-00053-of-00079.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:21ff689e188b368677fc5efd80e3eb9f7dc3ab8ff7492efc7af38e80bdf01fe2
3
+ size 515131899
1354_pegase/test-00054-of-00079.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d76ca00cfe4399beb92c08b7582f59495744b55c70520d3e523ad90c79a726cf
3
+ size 515264800
1354_pegase/test-00055-of-00079.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:929b544ebe4e16907d27cc6868ec6c3998929091d398e57e967566b0f52a51f1
3
+ size 515140784
1354_pegase/test-00056-of-00079.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8cd9f86ef822bc75ed8eb57ed5fc7e2b15dbc06117063ddef4b6178c0e50df3a
3
+ size 515352793
1354_pegase/test-00057-of-00079.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:93f35018dc3bc652e575becf90280ab8bf66fe24dcf4cfeb855f34a51c19e399
3
+ size 515083113
1354_pegase/test-00058-of-00079.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5089c3e454d206591a2817f9ce2e13b3bbb8635f192b24e7a00d1d7e36a2d115
3
+ size 515447004
1354_pegase/test-00059-of-00079.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4d50765104f3f64be0eb4785b70edb11f28a56e7fd5da21ed51db83758ff5d8d
3
+ size 515401442
1354_pegase/test-00060-of-00079.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5c205bd2f213e0bd93f7fa929cc3f61e3d9795d4753f6dc350f75f4f10bb14bd
3
+ size 515189738
1354_pegase/test-00061-of-00079.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e857aceae246eded28dea71fafa9be1bf6eb0abe518de32734419bfb8369eef1
3
+ size 515058118
1354_pegase/test-00062-of-00079.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e59a0a2ff5eb617d1faaf292de1b10b15f583d735f6b7fcb704a5636b2f29474
3
+ size 515244098
1354_pegase/test-00063-of-00079.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b20c5e91a3ff0bb0333aa432a2398df1ff8e0346b503a427bfdf5ae1fbb3baa9
3
+ size 515174836
1354_pegase/test-00064-of-00079.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:833536cc75ea6c0ccd8543942db11942b7d1c7ae1c1e7662c7ef599a29b7410b
3
+ size 515387277
1354_pegase/test-00065-of-00079.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6c7625fc150df40e80b10b35d3bbe6726e418030c20c70089cb5c073de6d4849
3
+ size 515238618
1354_pegase/test-00066-of-00079.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:08a7efe5985d587b4865607228f09f00f191f5c4420877b6c34fc09d6567f435
3
+ size 515207221
1354_pegase/test-00067-of-00079.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:34aba13071f01e00d668fadd08ce5efc2669f2eb79725643a735a36fe4879669
3
+ size 515272338
1354_pegase/test-00068-of-00079.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:35aeb23c6c47494214ded322e95320cd6d971fe66b89e64e37bf4c2fb0804d89
3
+ size 515265151
1354_pegase/test-00069-of-00079.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:828c8b058db03182d7d2c51e904a1a470ba05e045590c838a69bafd6282d2bca
3
+ size 515224054
1354_pegase/test-00070-of-00079.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5b936196db9ab3fb1927866f50e8b87ab956ca7ee9282a77e8704e789afc93df
3
+ size 515114321
1354_pegase/test-00071-of-00079.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:192964643337a42b2c29013896deffdcfa8bedc1e48a21a4dbc4abbb8442018b
3
+ size 514728749
1354_pegase/test-00072-of-00079.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8d580a0c4df0d8a4836d101e0e3f5affbb3e6a8d50f43e6dbc306e15a95bc4aa
3
+ size 514638138
1354_pegase/test-00073-of-00079.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d8a62948cd1a588b1401cb43e09be4d70eba40abf1d2ffbefb43fcadc4486b5c
3
+ size 514820889
1354_pegase/test-00074-of-00079.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:75460bb5b82a02d7bc511c778866130cc6f891f848cfcd4d3a64202b982ed7b3
3
+ size 514648251
1354_pegase/test-00075-of-00079.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:54d844122a981fbd65bca6056055198371668f29487d8216648062b57a78f385
3
+ size 514668478
1354_pegase/test-00076-of-00079.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fe3db19508221cd523c92c95f7cac9522086f5c2d76a1e348cd93867970f5325
3
+ size 514628077
1354_pegase/test-00077-of-00079.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ee6f84dd3119269e15a49909e2a95bb17835b7d1cf537bb1cbf774eea84cd2c3
3
+ size 514515861
1354_pegase/test-00078-of-00079.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:620ca53d0652ff4953c4c699072df0c80ca894aa907cb87ac1976fec9fccab52
3
+ size 514690265
PGLearn-Medium-1354_pegase.py DELETED
@@ -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 = "1354_pegase"
24
- SIZES = CaseSizes(n_bus=1354, n_load=673, n_gen=260, n_branch=1991)
25
- NUM_TRAIN = 355464
26
- NUM_TEST = 88867
27
- NUM_INFEASIBLE = 55669
28
- SPLITFILES = {
29
- "train/SOCOPF/dual.h5.gz": ["train/SOCOPF/dual/xaa", "train/SOCOPF/dual/xab"],
30
- }
31
-
32
- URL = "https://huggingface.co/datasets/PGLearn/PGLearn-Medium-1354_pegase"
33
- DESCRIPTION = """\
34
- The 1354_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-1354_pegase/blob/script/case.json.gz
42
- """
43
- USE_ML4OPF_WARNING = """
44
- ================================================================================================
45
- Loading PGLearn-Medium-1354_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-1354_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 PGLearnMedium1354_pegaseConfig(hfd.BuilderConfig):
100
- """BuilderConfig for PGLearn-Medium-1354_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(PGLearnMedium1354_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 PGLearnMedium1354_pegase(hfd.ArrowBasedBuilder):
210
- """DatasetBuilder for PGLearn-Medium-1354_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-1354_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 = PGLearnMedium1354_pegaseConfig
226
- DEFAULT_CONFIG_NAME=CASENAME
227
- BUILDER_CONFIGS = [
228
- PGLearnMedium1354_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")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
README.md ADDED
@@ -0,0 +1,292 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ dataset_info:
3
+ config_name: 1354_pegase
4
+ features:
5
+ - name: input/pd
6
+ sequence: float32
7
+ length: 673
8
+ - name: input/qd
9
+ sequence: float32
10
+ length: 673
11
+ - name: input/gen_status
12
+ sequence: bool
13
+ length: 260
14
+ - name: input/branch_status
15
+ sequence: bool
16
+ length: 1991
17
+ - name: input/seed
18
+ dtype: int64
19
+ - name: ACOPF/primal/vm
20
+ sequence: float32
21
+ length: 1354
22
+ - name: ACOPF/primal/va
23
+ sequence: float32
24
+ length: 1354
25
+ - name: ACOPF/primal/pg
26
+ sequence: float32
27
+ length: 260
28
+ - name: ACOPF/primal/qg
29
+ sequence: float32
30
+ length: 260
31
+ - name: ACOPF/primal/pf
32
+ sequence: float32
33
+ length: 1991
34
+ - name: ACOPF/primal/pt
35
+ sequence: float32
36
+ length: 1991
37
+ - name: ACOPF/primal/qf
38
+ sequence: float32
39
+ length: 1991
40
+ - name: ACOPF/primal/qt
41
+ sequence: float32
42
+ length: 1991
43
+ - name: ACOPF/dual/kcl_p
44
+ sequence: float32
45
+ length: 1354
46
+ - name: ACOPF/dual/kcl_q
47
+ sequence: float32
48
+ length: 1354
49
+ - name: ACOPF/dual/vm
50
+ sequence: float32
51
+ length: 1354
52
+ - name: ACOPF/dual/pg
53
+ sequence: float32
54
+ length: 260
55
+ - name: ACOPF/dual/qg
56
+ sequence: float32
57
+ length: 260
58
+ - name: ACOPF/dual/ohm_pf
59
+ sequence: float32
60
+ length: 1991
61
+ - name: ACOPF/dual/ohm_pt
62
+ sequence: float32
63
+ length: 1991
64
+ - name: ACOPF/dual/ohm_qf
65
+ sequence: float32
66
+ length: 1991
67
+ - name: ACOPF/dual/ohm_qt
68
+ sequence: float32
69
+ length: 1991
70
+ - name: ACOPF/dual/pf
71
+ sequence: float32
72
+ length: 1991
73
+ - name: ACOPF/dual/pt
74
+ sequence: float32
75
+ length: 1991
76
+ - name: ACOPF/dual/qf
77
+ sequence: float32
78
+ length: 1991
79
+ - name: ACOPF/dual/qt
80
+ sequence: float32
81
+ length: 1991
82
+ - name: ACOPF/dual/va_diff
83
+ sequence: float32
84
+ length: 1991
85
+ - name: ACOPF/dual/sm_fr
86
+ sequence: float32
87
+ length: 1991
88
+ - name: ACOPF/dual/sm_to
89
+ sequence: float32
90
+ length: 1991
91
+ - name: ACOPF/dual/slack_bus
92
+ dtype: float32
93
+ - name: ACOPF/meta/seed
94
+ dtype: int64
95
+ - name: ACOPF/meta/formulation
96
+ dtype: string
97
+ - name: ACOPF/meta/primal_objective_value
98
+ dtype: float32
99
+ - name: ACOPF/meta/dual_objective_value
100
+ dtype: float32
101
+ - name: ACOPF/meta/primal_status
102
+ dtype: string
103
+ - name: ACOPF/meta/dual_status
104
+ dtype: string
105
+ - name: ACOPF/meta/termination_status
106
+ dtype: string
107
+ - name: ACOPF/meta/build_time
108
+ dtype: float32
109
+ - name: ACOPF/meta/extract_time
110
+ dtype: float32
111
+ - name: ACOPF/meta/solve_time
112
+ dtype: float32
113
+ - name: DCOPF/primal/va
114
+ sequence: float32
115
+ length: 1354
116
+ - name: DCOPF/primal/pg
117
+ sequence: float32
118
+ length: 260
119
+ - name: DCOPF/primal/pf
120
+ sequence: float32
121
+ length: 1991
122
+ - name: DCOPF/dual/kcl_p
123
+ sequence: float32
124
+ length: 1354
125
+ - name: DCOPF/dual/pg
126
+ sequence: float32
127
+ length: 260
128
+ - name: DCOPF/dual/ohm_pf
129
+ sequence: float32
130
+ length: 1991
131
+ - name: DCOPF/dual/pf
132
+ sequence: float32
133
+ length: 1991
134
+ - name: DCOPF/dual/va_diff
135
+ sequence: float32
136
+ length: 1991
137
+ - name: DCOPF/dual/slack_bus
138
+ dtype: float32
139
+ - name: DCOPF/meta/seed
140
+ dtype: int64
141
+ - name: DCOPF/meta/formulation
142
+ dtype: string
143
+ - name: DCOPF/meta/primal_objective_value
144
+ dtype: float32
145
+ - name: DCOPF/meta/dual_objective_value
146
+ dtype: float32
147
+ - name: DCOPF/meta/primal_status
148
+ dtype: string
149
+ - name: DCOPF/meta/dual_status
150
+ dtype: string
151
+ - name: DCOPF/meta/termination_status
152
+ dtype: string
153
+ - name: DCOPF/meta/build_time
154
+ dtype: float32
155
+ - name: DCOPF/meta/extract_time
156
+ dtype: float32
157
+ - name: DCOPF/meta/solve_time
158
+ dtype: float32
159
+ - name: SOCOPF/primal/w
160
+ sequence: float32
161
+ length: 1354
162
+ - name: SOCOPF/primal/pg
163
+ sequence: float32
164
+ length: 260
165
+ - name: SOCOPF/primal/qg
166
+ sequence: float32
167
+ length: 260
168
+ - name: SOCOPF/primal/pf
169
+ sequence: float32
170
+ length: 1991
171
+ - name: SOCOPF/primal/pt
172
+ sequence: float32
173
+ length: 1991
174
+ - name: SOCOPF/primal/qf
175
+ sequence: float32
176
+ length: 1991
177
+ - name: SOCOPF/primal/qt
178
+ sequence: float32
179
+ length: 1991
180
+ - name: SOCOPF/primal/wr
181
+ sequence: float32
182
+ length: 1991
183
+ - name: SOCOPF/primal/wi
184
+ sequence: float32
185
+ length: 1991
186
+ - name: SOCOPF/dual/kcl_p
187
+ sequence: float32
188
+ length: 1354
189
+ - name: SOCOPF/dual/kcl_q
190
+ sequence: float32
191
+ length: 1354
192
+ - name: SOCOPF/dual/w
193
+ sequence: float32
194
+ length: 1354
195
+ - name: SOCOPF/dual/pg
196
+ sequence: float32
197
+ length: 260
198
+ - name: SOCOPF/dual/qg
199
+ sequence: float32
200
+ length: 260
201
+ - name: SOCOPF/dual/ohm_pf
202
+ sequence: float32
203
+ length: 1991
204
+ - name: SOCOPF/dual/ohm_pt
205
+ sequence: float32
206
+ length: 1991
207
+ - name: SOCOPF/dual/ohm_qf
208
+ sequence: float32
209
+ length: 1991
210
+ - name: SOCOPF/dual/ohm_qt
211
+ sequence: float32
212
+ length: 1991
213
+ - name: SOCOPF/dual/jabr
214
+ dtype:
215
+ array2_d:
216
+ shape:
217
+ - 1991
218
+ - 4
219
+ dtype: float32
220
+ - name: SOCOPF/dual/sm_fr
221
+ dtype:
222
+ array2_d:
223
+ shape:
224
+ - 1991
225
+ - 3
226
+ dtype: float32
227
+ - name: SOCOPF/dual/sm_to
228
+ dtype:
229
+ array2_d:
230
+ shape:
231
+ - 1991
232
+ - 3
233
+ dtype: float32
234
+ - name: SOCOPF/dual/va_diff
235
+ sequence: float32
236
+ length: 1991
237
+ - name: SOCOPF/dual/wr
238
+ sequence: float32
239
+ length: 1991
240
+ - name: SOCOPF/dual/wi
241
+ sequence: float32
242
+ length: 1991
243
+ - name: SOCOPF/dual/pf
244
+ sequence: float32
245
+ length: 1991
246
+ - name: SOCOPF/dual/pt
247
+ sequence: float32
248
+ length: 1991
249
+ - name: SOCOPF/dual/qf
250
+ sequence: float32
251
+ length: 1991
252
+ - name: SOCOPF/dual/qt
253
+ sequence: float32
254
+ length: 1991
255
+ - name: SOCOPF/meta/seed
256
+ dtype: int64
257
+ - name: SOCOPF/meta/formulation
258
+ dtype: string
259
+ - name: SOCOPF/meta/primal_objective_value
260
+ dtype: float32
261
+ - name: SOCOPF/meta/dual_objective_value
262
+ dtype: float32
263
+ - name: SOCOPF/meta/primal_status
264
+ dtype: string
265
+ - name: SOCOPF/meta/dual_status
266
+ dtype: string
267
+ - name: SOCOPF/meta/termination_status
268
+ dtype: string
269
+ - name: SOCOPF/meta/build_time
270
+ dtype: float32
271
+ - name: SOCOPF/meta/extract_time
272
+ dtype: float32
273
+ - name: SOCOPF/meta/solve_time
274
+ dtype: float32
275
+ splits:
276
+ - name: train
277
+ num_bytes: 157235012667
278
+ num_examples: 355464
279
+ - name: test
280
+ num_bytes: 39309195505
281
+ num_examples: 88867
282
+ download_size: 203615755876
283
+ dataset_size: 196544208172
284
+ configs:
285
+ - config_name: 1354_pegase
286
+ data_files:
287
+ - split: train
288
+ path: 1354_pegase/train-*
289
+ - split: test
290
+ path: 1354_pegase/test-*
291
+ default: true
292
+ ---