klamike commited on
Commit
2bb019d
·
verified ·
1 Parent(s): a999ded
Files changed (42) hide show
  1. PGLearn-Large-Texas7k.py +0 -393
  2. README.md +7 -1
  3. data/ACOPF/meta.h5.gz → Texas7k/data-00400-of-00430.parquet +2 -2
  4. case.json.gz → Texas7k/data-00401-of-00430.parquet +2 -2
  5. data/SOCOPF/meta.h5.gz → Texas7k/data-00402-of-00430.parquet +2 -2
  6. data/DCOPF/meta.h5.gz → Texas7k/data-00403-of-00430.parquet +2 -2
  7. Texas7k/data-00404-of-00430.parquet +3 -0
  8. Texas7k/data-00405-of-00430.parquet +3 -0
  9. Texas7k/data-00406-of-00430.parquet +3 -0
  10. Texas7k/data-00407-of-00430.parquet +3 -0
  11. Texas7k/data-00408-of-00430.parquet +3 -0
  12. Texas7k/data-00409-of-00430.parquet +3 -0
  13. Texas7k/data-00410-of-00430.parquet +3 -0
  14. Texas7k/data-00411-of-00430.parquet +3 -0
  15. Texas7k/data-00412-of-00430.parquet +3 -0
  16. Texas7k/data-00413-of-00430.parquet +3 -0
  17. Texas7k/data-00414-of-00430.parquet +3 -0
  18. Texas7k/data-00415-of-00430.parquet +3 -0
  19. Texas7k/data-00416-of-00430.parquet +3 -0
  20. Texas7k/data-00417-of-00430.parquet +3 -0
  21. Texas7k/data-00418-of-00430.parquet +3 -0
  22. Texas7k/data-00419-of-00430.parquet +3 -0
  23. Texas7k/data-00420-of-00430.parquet +3 -0
  24. Texas7k/data-00421-of-00430.parquet +3 -0
  25. Texas7k/data-00422-of-00430.parquet +3 -0
  26. Texas7k/data-00423-of-00430.parquet +3 -0
  27. Texas7k/data-00424-of-00430.parquet +3 -0
  28. Texas7k/data-00425-of-00430.parquet +3 -0
  29. Texas7k/data-00426-of-00430.parquet +3 -0
  30. Texas7k/data-00427-of-00430.parquet +3 -0
  31. Texas7k/data-00428-of-00430.parquet +3 -0
  32. Texas7k/data-00429-of-00430.parquet +3 -0
  33. config.toml +0 -37
  34. data/ACOPF/dual.h5.gz +0 -3
  35. data/ACOPF/primal.h5.gz +0 -3
  36. data/DCOPF/dual.h5.gz +0 -3
  37. data/DCOPF/primal.h5.gz +0 -3
  38. data/SOCOPF/dual/xaa +0 -3
  39. data/SOCOPF/dual/xab +0 -3
  40. data/SOCOPF/dual/xac +0 -3
  41. data/SOCOPF/primal.h5.gz +0 -3
  42. data/input.h5.gz +0 -3
PGLearn-Large-Texas7k.py DELETED
@@ -1,393 +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 = "Texas7k"
24
- SIZES = CaseSizes(n_bus=6717, n_load=4549, n_gen=637, n_branch=9140)
25
- NUM_SAMPLES = 105237
26
- SPLITFILES = {
27
- "data/SOCOPF/dual.h5.gz": ["data/SOCOPF/dual/xaa", "data/SOCOPF/dual/xab", "data/SOCOPF/dual/xac"],
28
- }
29
-
30
- URL = "https://huggingface.co/datasets/PGLearn/PGLearn-Large-Texas7k"
31
- DESCRIPTION = """\
32
- The Texas7k PGLearn optimal power flow dataset, part of the PGLearn-Large collection. \
33
- """
34
- VERSION = hfd.Version("1.0.0")
35
- DEFAULT_CONFIG_DESCRIPTION="""\
36
- This configuration contains input, primal solution, and dual solution data \
37
- for the ACOPF, DCOPF, and SOCOPF 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-Large-Texas7k/blob/script/case.json.gz
40
- """
41
- USE_ML4OPF_WARNING = """
42
- ================================================================================================
43
- Loading PGLearn-Large-Texas7k 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-Large-Texas7k#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 PGLearnLargeTexas7kConfig(hfd.BuilderConfig):
98
- """BuilderConfig for PGLearn-Large-Texas7k.
99
- By default, primal solution data, metadata, input, casejson, are included.
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
- """
111
- def __init__(self,
112
- formulations: list[str],
113
- primal: bool=True, dual: bool=False, meta: bool=True, input: bool = True, casejson: bool=True,
114
- compressed: bool=IS_COMPRESSED, **kwargs
115
- ):
116
- super(PGLearnLargeTexas7kConfig, self).__init__(version=VERSION, **kwargs)
117
-
118
- self.case = CASENAME
119
- self.formulations = formulations
120
-
121
- self.primal = primal
122
- self.dual = dual
123
- self.meta = meta
124
- self.input = input
125
- self.casejson = casejson
126
-
127
- self.gz_ext = ".gz" if compressed else ""
128
-
129
- @property
130
- def size(self):
131
- return SIZES
132
-
133
- @property
134
- def features(self):
135
- features = {}
136
- if self.casejson: features.update(case_features())
137
- if self.input: features.update(input_features(SIZES))
138
- for formulation in self.formulations:
139
- features.update(FORMULATIONS_TO_FEATURES[formulation](SIZES, self.primal, self.dual, self.meta))
140
- return hfd.Features(features)
141
-
142
- @property
143
- def splits(self):
144
- splits: dict[hfd.Split, dict[str, str | int]] = {}
145
- splits["data"] = {
146
- "name": "data",
147
- "num_examples": NUM_SAMPLES
148
- }
149
- return splits
150
-
151
- @property
152
- def urls(self):
153
- urls: dict[str, None | str | list] = {
154
- "case": None, "data": [],
155
- }
156
-
157
- if self.casejson:
158
- urls["case"] = f"case.json" + self.gz_ext
159
- else:
160
- urls.pop("case")
161
-
162
- split_names = ["data"]
163
-
164
- for split in split_names:
165
- if self.input: urls[split].append(f"{split}/input.h5" + self.gz_ext)
166
- for formulation in self.formulations:
167
- if self.primal:
168
- filename = f"{split}/{formulation}/primal.h5" + self.gz_ext
169
- if filename in SPLITFILES: urls[split].append(SPLITFILES[filename])
170
- else: urls[split].append(filename)
171
- if self.dual:
172
- filename = f"{split}/{formulation}/dual.h5" + self.gz_ext
173
- if filename in SPLITFILES: urls[split].append(SPLITFILES[filename])
174
- else: urls[split].append(filename)
175
- if self.meta:
176
- filename = f"{split}/{formulation}/meta.h5" + self.gz_ext
177
- if filename in SPLITFILES: urls[split].append(SPLITFILES[filename])
178
- else: urls[split].append(filename)
179
- return urls
180
-
181
- # ┌────────────────────┐
182
- # │ DatasetBuilder │
183
- # └────────────────────┘
184
-
185
- class PGLearnLargeTexas7k(hfd.ArrowBasedBuilder):
186
- """DatasetBuilder for PGLearn-Large-Texas7k.
187
- The main interface is `datasets.load_dataset` with `trust_remote_code=True`, e.g.
188
-
189
- ```python
190
- from datasets import load_dataset
191
- ds = load_dataset("PGLearn/PGLearn-Large-Texas7k", trust_remote_code=True,
192
- # modify the default configuration by passing kwargs
193
- formulations=["DCOPF"],
194
- dual=False,
195
- meta=False,
196
- )
197
- ```
198
- """
199
-
200
- DEFAULT_WRITER_BATCH_SIZE = 10000
201
- BUILDER_CONFIG_CLASS = PGLearnLargeTexas7kConfig
202
- DEFAULT_CONFIG_NAME=CASENAME
203
- BUILDER_CONFIGS = [
204
- PGLearnLargeTexas7kConfig(
205
- name=CASENAME, description=DEFAULT_CONFIG_DESCRIPTION.format(case=CASENAME),
206
- formulations=list(FORMULATIONS_TO_FEATURES.keys()),
207
- primal=True, dual=True, meta=True, input=True, casejson=False,
208
- )
209
- ]
210
-
211
- def _info(self):
212
- return hfd.DatasetInfo(
213
- features=self.config.features, splits=self.config.splits,
214
- description=DESCRIPTION + self.config.description,
215
- homepage=URL, citation=CITATION,
216
- )
217
-
218
- def _split_generators(self, dl_manager: hfd.DownloadManager):
219
- hfd.logging.get_logger().warning(USE_ML4OPF_WARNING)
220
-
221
- filepaths = dl_manager.download_and_extract(self.config.urls)
222
-
223
- splits: list[hfd.SplitGenerator] = []
224
- splits.append(hfd.SplitGenerator(
225
- name=hfd.Split("data"),
226
- gen_kwargs=dict(case_file=filepaths.get("case", None), data_files=tuple(filepaths["data"]), n_samples=NUM_SAMPLES),
227
- ))
228
- return splits
229
-
230
- 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):
231
- case_data: str | None = json.dumps(json.load(open_maybe_gzip_cat(case_file))) if case_file is not None else None
232
- data: dict[str, h5py.File] = {}
233
- for file in data_files:
234
- v = h5py.File(open_maybe_gzip_cat(file), "r")
235
- if isinstance(file, list):
236
- k = "/".join(Path(file[0].get_origin()).parts[-3:-1]).split(".")[0]
237
- else:
238
- k = "/".join(Path(file.get_origin()).parts[-2:]).split(".")[0]
239
- data[k] = v
240
- for k in list(data.keys()):
241
- if "/input" in k: data[k.split("/", 1)[1]] = data.pop(k)
242
-
243
- batch_size = self._writer_batch_size or self.DEFAULT_WRITER_BATCH_SIZE
244
- for i in range(0, n_samples, batch_size):
245
- effective_batch_size = min(batch_size, n_samples - i)
246
-
247
- sample_data = {
248
- f"{dk}/{k}":
249
- hfd.features.features.numpy_to_pyarrow_listarray(v[i:i + effective_batch_size, ...])
250
- for dk, d in data.items() for k, v in d.items() if f"{dk}/{k}" in self.config.features
251
- }
252
-
253
- if case_data is not None:
254
- sample_data["case/json"] = pa.array([case_data] * effective_batch_size)
255
-
256
- yield i, pa.Table.from_pydict(sample_data)
257
-
258
- for f in data.values():
259
- f.close()
260
-
261
- # ┌──────────────┐
262
- # │ Features │
263
- # └──────────────┘
264
-
265
- FLOAT_TYPE = "float32"
266
- INT_TYPE = "int64"
267
- BOOL_TYPE = "bool"
268
- STRING_TYPE = "string"
269
-
270
- def case_features():
271
- # FIXME: better way to share schema of case data -- need to treat jagged arrays
272
- return {
273
- "case/json": hfd.Value(STRING_TYPE),
274
- }
275
-
276
- META_FEATURES = {
277
- "meta/seed": hfd.Value(dtype=INT_TYPE),
278
- "meta/formulation": hfd.Value(dtype=STRING_TYPE),
279
- "meta/primal_objective_value": hfd.Value(dtype=FLOAT_TYPE),
280
- "meta/dual_objective_value": hfd.Value(dtype=FLOAT_TYPE),
281
- "meta/primal_status": hfd.Value(dtype=STRING_TYPE),
282
- "meta/dual_status": hfd.Value(dtype=STRING_TYPE),
283
- "meta/termination_status": hfd.Value(dtype=STRING_TYPE),
284
- "meta/build_time": hfd.Value(dtype=FLOAT_TYPE),
285
- "meta/extract_time": hfd.Value(dtype=FLOAT_TYPE),
286
- "meta/solve_time": hfd.Value(dtype=FLOAT_TYPE),
287
- }
288
-
289
- def input_features(sizes: CaseSizes):
290
- return {
291
- "input/pd": hfd.Sequence(length=sizes.n_load, feature=hfd.Value(dtype=FLOAT_TYPE)),
292
- "input/qd": hfd.Sequence(length=sizes.n_load, feature=hfd.Value(dtype=FLOAT_TYPE)),
293
- "input/gen_status": hfd.Sequence(length=sizes.n_gen, feature=hfd.Value(dtype=BOOL_TYPE)),
294
- "input/branch_status": hfd.Sequence(length=sizes.n_branch, feature=hfd.Value(dtype=BOOL_TYPE)),
295
- "input/seed": hfd.Value(dtype=INT_TYPE),
296
- }
297
-
298
- def acopf_primal_features(sizes: CaseSizes):
299
- return {
300
- "ACOPF/primal/vm": hfd.Sequence(length=sizes.n_bus, feature=hfd.Value(dtype=FLOAT_TYPE)),
301
- "ACOPF/primal/va": hfd.Sequence(length=sizes.n_bus, feature=hfd.Value(dtype=FLOAT_TYPE)),
302
- "ACOPF/primal/pg": hfd.Sequence(length=sizes.n_gen, feature=hfd.Value(dtype=FLOAT_TYPE)),
303
- "ACOPF/primal/qg": hfd.Sequence(length=sizes.n_gen, feature=hfd.Value(dtype=FLOAT_TYPE)),
304
- "ACOPF/primal/pf": hfd.Sequence(length=sizes.n_branch, feature=hfd.Value(dtype=FLOAT_TYPE)),
305
- "ACOPF/primal/pt": hfd.Sequence(length=sizes.n_branch, feature=hfd.Value(dtype=FLOAT_TYPE)),
306
- "ACOPF/primal/qf": hfd.Sequence(length=sizes.n_branch, feature=hfd.Value(dtype=FLOAT_TYPE)),
307
- "ACOPF/primal/qt": hfd.Sequence(length=sizes.n_branch, feature=hfd.Value(dtype=FLOAT_TYPE)),
308
- }
309
- def acopf_dual_features(sizes: CaseSizes):
310
- return {
311
- "ACOPF/dual/kcl_p": hfd.Sequence(length=sizes.n_bus, feature=hfd.Value(dtype=FLOAT_TYPE)),
312
- "ACOPF/dual/kcl_q": hfd.Sequence(length=sizes.n_bus, feature=hfd.Value(dtype=FLOAT_TYPE)),
313
- "ACOPF/dual/vm": hfd.Sequence(length=sizes.n_bus, feature=hfd.Value(dtype=FLOAT_TYPE)),
314
- "ACOPF/dual/pg": hfd.Sequence(length=sizes.n_gen, feature=hfd.Value(dtype=FLOAT_TYPE)),
315
- "ACOPF/dual/qg": hfd.Sequence(length=sizes.n_gen, feature=hfd.Value(dtype=FLOAT_TYPE)),
316
- "ACOPF/dual/ohm_pf": hfd.Sequence(length=sizes.n_branch, feature=hfd.Value(dtype=FLOAT_TYPE)),
317
- "ACOPF/dual/ohm_pt": hfd.Sequence(length=sizes.n_branch, feature=hfd.Value(dtype=FLOAT_TYPE)),
318
- "ACOPF/dual/ohm_qf": hfd.Sequence(length=sizes.n_branch, feature=hfd.Value(dtype=FLOAT_TYPE)),
319
- "ACOPF/dual/ohm_qt": hfd.Sequence(length=sizes.n_branch, feature=hfd.Value(dtype=FLOAT_TYPE)),
320
- "ACOPF/dual/pf": hfd.Sequence(length=sizes.n_branch, feature=hfd.Value(dtype=FLOAT_TYPE)),
321
- "ACOPF/dual/pt": hfd.Sequence(length=sizes.n_branch, feature=hfd.Value(dtype=FLOAT_TYPE)),
322
- "ACOPF/dual/qf": hfd.Sequence(length=sizes.n_branch, feature=hfd.Value(dtype=FLOAT_TYPE)),
323
- "ACOPF/dual/qt": hfd.Sequence(length=sizes.n_branch, feature=hfd.Value(dtype=FLOAT_TYPE)),
324
- "ACOPF/dual/va_diff": hfd.Sequence(length=sizes.n_branch, feature=hfd.Value(dtype=FLOAT_TYPE)),
325
- "ACOPF/dual/sm_fr": hfd.Sequence(length=sizes.n_branch, feature=hfd.Value(dtype=FLOAT_TYPE)),
326
- "ACOPF/dual/sm_to": hfd.Sequence(length=sizes.n_branch, feature=hfd.Value(dtype=FLOAT_TYPE)),
327
- "ACOPF/dual/slack_bus": hfd.Value(dtype=FLOAT_TYPE),
328
- }
329
- def dcopf_primal_features(sizes: CaseSizes):
330
- return {
331
- "DCOPF/primal/va": hfd.Sequence(length=sizes.n_bus, feature=hfd.Value(dtype=FLOAT_TYPE)),
332
- "DCOPF/primal/pg": hfd.Sequence(length=sizes.n_gen, feature=hfd.Value(dtype=FLOAT_TYPE)),
333
- "DCOPF/primal/pf": hfd.Sequence(length=sizes.n_branch, feature=hfd.Value(dtype=FLOAT_TYPE)),
334
- }
335
- def dcopf_dual_features(sizes: CaseSizes):
336
- return {
337
- "DCOPF/dual/kcl_p": hfd.Sequence(length=sizes.n_bus, feature=hfd.Value(dtype=FLOAT_TYPE)),
338
- "DCOPF/dual/pg": hfd.Sequence(length=sizes.n_gen, feature=hfd.Value(dtype=FLOAT_TYPE)),
339
- "DCOPF/dual/ohm_pf": hfd.Sequence(length=sizes.n_branch, feature=hfd.Value(dtype=FLOAT_TYPE)),
340
- "DCOPF/dual/pf": hfd.Sequence(length=sizes.n_branch, feature=hfd.Value(dtype=FLOAT_TYPE)),
341
- "DCOPF/dual/va_diff": hfd.Sequence(length=sizes.n_branch, feature=hfd.Value(dtype=FLOAT_TYPE)),
342
- "DCOPF/dual/slack_bus": hfd.Value(dtype=FLOAT_TYPE),
343
- }
344
- def socopf_primal_features(sizes: CaseSizes):
345
- return {
346
- "SOCOPF/primal/w": hfd.Sequence(length=sizes.n_bus, feature=hfd.Value(dtype=FLOAT_TYPE)),
347
- "SOCOPF/primal/pg": hfd.Sequence(length=sizes.n_gen, feature=hfd.Value(dtype=FLOAT_TYPE)),
348
- "SOCOPF/primal/qg": hfd.Sequence(length=sizes.n_gen, feature=hfd.Value(dtype=FLOAT_TYPE)),
349
- "SOCOPF/primal/pf": hfd.Sequence(length=sizes.n_branch, feature=hfd.Value(dtype=FLOAT_TYPE)),
350
- "SOCOPF/primal/pt": hfd.Sequence(length=sizes.n_branch, feature=hfd.Value(dtype=FLOAT_TYPE)),
351
- "SOCOPF/primal/qf": hfd.Sequence(length=sizes.n_branch, feature=hfd.Value(dtype=FLOAT_TYPE)),
352
- "SOCOPF/primal/qt": hfd.Sequence(length=sizes.n_branch, feature=hfd.Value(dtype=FLOAT_TYPE)),
353
- "SOCOPF/primal/wr": hfd.Sequence(length=sizes.n_branch, feature=hfd.Value(dtype=FLOAT_TYPE)),
354
- "SOCOPF/primal/wi": hfd.Sequence(length=sizes.n_branch, feature=hfd.Value(dtype=FLOAT_TYPE)),
355
- }
356
- def socopf_dual_features(sizes: CaseSizes):
357
- return {
358
- "SOCOPF/dual/kcl_p": hfd.Sequence(length=sizes.n_bus, feature=hfd.Value(dtype=FLOAT_TYPE)),
359
- "SOCOPF/dual/kcl_q": hfd.Sequence(length=sizes.n_bus, feature=hfd.Value(dtype=FLOAT_TYPE)),
360
- "SOCOPF/dual/w": hfd.Sequence(length=sizes.n_bus, feature=hfd.Value(dtype=FLOAT_TYPE)),
361
- "SOCOPF/dual/pg": hfd.Sequence(length=sizes.n_gen, feature=hfd.Value(dtype=FLOAT_TYPE)),
362
- "SOCOPF/dual/qg": hfd.Sequence(length=sizes.n_gen, feature=hfd.Value(dtype=FLOAT_TYPE)),
363
- "SOCOPF/dual/ohm_pf": hfd.Sequence(length=sizes.n_branch, feature=hfd.Value(dtype=FLOAT_TYPE)),
364
- "SOCOPF/dual/ohm_pt": hfd.Sequence(length=sizes.n_branch, feature=hfd.Value(dtype=FLOAT_TYPE)),
365
- "SOCOPF/dual/ohm_qf": hfd.Sequence(length=sizes.n_branch, feature=hfd.Value(dtype=FLOAT_TYPE)),
366
- "SOCOPF/dual/ohm_qt": hfd.Sequence(length=sizes.n_branch, feature=hfd.Value(dtype=FLOAT_TYPE)),
367
- "SOCOPF/dual/jabr": hfd.Array2D(shape=(sizes.n_branch, 4), dtype=FLOAT_TYPE),
368
- "SOCOPF/dual/sm_fr": hfd.Array2D(shape=(sizes.n_branch, 3), dtype=FLOAT_TYPE),
369
- "SOCOPF/dual/sm_to": hfd.Array2D(shape=(sizes.n_branch, 3), dtype=FLOAT_TYPE),
370
- "SOCOPF/dual/va_diff": hfd.Sequence(length=sizes.n_branch, feature=hfd.Value(dtype=FLOAT_TYPE)),
371
- "SOCOPF/dual/wr": hfd.Sequence(length=sizes.n_branch, feature=hfd.Value(dtype=FLOAT_TYPE)),
372
- "SOCOPF/dual/wi": hfd.Sequence(length=sizes.n_branch, feature=hfd.Value(dtype=FLOAT_TYPE)),
373
- "SOCOPF/dual/pf": hfd.Sequence(length=sizes.n_branch, feature=hfd.Value(dtype=FLOAT_TYPE)),
374
- "SOCOPF/dual/pt": hfd.Sequence(length=sizes.n_branch, feature=hfd.Value(dtype=FLOAT_TYPE)),
375
- "SOCOPF/dual/qf": hfd.Sequence(length=sizes.n_branch, feature=hfd.Value(dtype=FLOAT_TYPE)),
376
- "SOCOPF/dual/qt": hfd.Sequence(length=sizes.n_branch, feature=hfd.Value(dtype=FLOAT_TYPE)),
377
- }
378
-
379
- # ┌───────────────┐
380
- # │ Utilities │
381
- # └───────────────┘
382
-
383
- def open_maybe_gzip_cat(path: str | list):
384
- if isinstance(path, list):
385
- dest = Path(path[0]).parent.with_suffix(".h5")
386
- if not dest.exists():
387
- with open(dest, "wb") as dest_f:
388
- for piece in path:
389
- with open(piece, "rb") as piece_f:
390
- shutil.copyfileobj(piece_f, dest_f)
391
- shutil.rmtree(Path(piece).parent)
392
- path = dest.as_posix()
393
- return gzip.open(path, "rb") if path.endswith(".gz") else open(path, "rb")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
README.md CHANGED
@@ -285,6 +285,12 @@ dataset_info:
285
  - name: data
286
  num_bytes: 214763157127
287
  num_examples: 105237
288
- download_size: 186617660003
289
  dataset_size: 214763157127
 
 
 
 
 
 
290
  ---
 
285
  - name: data
286
  num_bytes: 214763157127
287
  num_examples: 105237
288
+ download_size: 213953715894
289
  dataset_size: 214763157127
290
+ configs:
291
+ - config_name: Texas7k
292
+ data_files:
293
+ - split: data
294
+ path: Texas7k/data-*
295
+ default: true
296
  ---
data/ACOPF/meta.h5.gz → Texas7k/data-00400-of-00430.parquet RENAMED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:1e03ec04620157f6582847d6a988fc0360fac5dc522452aa0f9382fa109b740b
3
- size 3601548
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8023bb0f3b0bfe252b81a6007c0644724a442484015bc64d5d39552b02c52887
3
+ size 495604697
case.json.gz → Texas7k/data-00401-of-00430.parquet RENAMED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:f97409987c316d69447827c3458824dbaeac150a0c25ef28d79791780b01a80d
3
- size 5242746
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:51037af4ddcd12882badc936956ea1c5dc0540c4e057b78a7465baa67543a682
3
+ size 494973167
data/SOCOPF/meta.h5.gz → Texas7k/data-00402-of-00430.parquet RENAMED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:2e3bd71dbeeb7ef71a4fac2f24cec0b1fe04acac57f08434e00c81b496fdbf4c
3
- size 3725353
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c89f1a96afba20c21469848da87db93b775ae08d40ec0a5d96dddd27527d4e9d
3
+ size 496132750
data/DCOPF/meta.h5.gz → Texas7k/data-00403-of-00430.parquet RENAMED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:572b3116e196c05ee343ca8682421286ab8acc80c8fad64705dca4543e4a153d
3
- size 3601826
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a8e9f5f57040b3a841b3bf12bb4ae24ef73ec601ab471ddfba3f9620a73f5ab2
3
+ size 496583382
Texas7k/data-00404-of-00430.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:dede88ae3896d71b548553b307e1689572817b0668a137ffc33d1bc6c26acf3a
3
+ size 495255140
Texas7k/data-00405-of-00430.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0f55fc54ab7b8f53a55207b711ce825675f748df8603e0b7ec56b3d92b239010
3
+ size 495129630
Texas7k/data-00406-of-00430.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2202679d6c93c658915f288e6d165544df6cffffe1f6cf623058a43b7e176e1e
3
+ size 493098640
Texas7k/data-00407-of-00430.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:69c48e2ea10c3cf080fd25c673061d294d12fa807ab577bc50f8a01bc7fb045d
3
+ size 492744769
Texas7k/data-00408-of-00430.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:98b15a44c36c571776a399548dce3e8f397d572b2d9a11f6c66a32ef3142c633
3
+ size 493512157
Texas7k/data-00409-of-00430.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2e79c53b91de124a5c835d05c85b80c4f2ea2fc59ccba2b00e77bcd869e65842
3
+ size 493990007
Texas7k/data-00410-of-00430.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c90aa8acd7b2e5b9c0adf30e353c27bfdd6ceabba32d430c1e9ae0afc4959e9f
3
+ size 496143287
Texas7k/data-00411-of-00430.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9e1769faf63245e8acdc214c7db3dfdbf1ca66dc1783a55ae00a16caf9e87722
3
+ size 496698432
Texas7k/data-00412-of-00430.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5a07de580ad2bb30c03ac23e52174e2712b2898f98e65ace03c5dd016183e96c
3
+ size 495099350
Texas7k/data-00413-of-00430.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:41b14b0cdd0444a068bbb8353a6552d29a4f05b8f787d19ffd49052e39455045
3
+ size 493496240
Texas7k/data-00414-of-00430.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a3c73be2cb159f78bbabf612edfe3ba0872f5e8fda437e2f3553921105588488
3
+ size 492542046
Texas7k/data-00415-of-00430.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:24c7120ba73d3b795b83bae1bc656dca23c2179560d3915b3006a8759e47fe1c
3
+ size 495241117
Texas7k/data-00416-of-00430.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9c02740a3196d9ec1011c0d0de3c243c821a664a6899e719a4ab2cbd78fcb97b
3
+ size 495695827
Texas7k/data-00417-of-00430.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1dca41253187df29d5f74470e1b19c0494eb8bb811e0726447b336f215d32026
3
+ size 495734509
Texas7k/data-00418-of-00430.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8a29fb6ce895a76d05ec743149594b580b795a5a621456198d4184942a784b44
3
+ size 494640519
Texas7k/data-00419-of-00430.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e74a27ae0a60d96e8dfff9503c88cd7844e533f380d81a797f58a0f9d1a92cb5
3
+ size 494609629
Texas7k/data-00420-of-00430.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2fd0c163e668b2b5da2014efbdabcd02e35f5eeb952aea31a476679a685e90c5
3
+ size 492386456
Texas7k/data-00421-of-00430.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7c4d0fa0741cac66c4c3e3d4b2ef210dee33bdde7ed5e101f55aec7e083f8bc0
3
+ size 492576229
Texas7k/data-00422-of-00430.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a920994a1577c64e82bf28aa7ec69a18056a7024a9bf4966cfdd6cec321d3e73
3
+ size 490703016
Texas7k/data-00423-of-00430.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f0e32f399d1e45f3831e8073f7f17846c21e350ab2385de314d2d1b35206e6bd
3
+ size 492348944
Texas7k/data-00424-of-00430.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0d8c48a1935072c9b38ef65d5c5c0407e8283215c135f7cdc16bc2774da6beae
3
+ size 494746996
Texas7k/data-00425-of-00430.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ac41b70721b0b256533faae016f145843222394fe16ea5ef5ef8287c31a7146e
3
+ size 496026456
Texas7k/data-00426-of-00430.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:835ef2eff76f7c4938c8a4ab0572c401ad58a78c66736be23dc2b5ef3a5638c3
3
+ size 493166895
Texas7k/data-00427-of-00430.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d9fd1fdcce431bc465fe252a9f3d0ffd4222286cccf985dcaa92a96447abe312
3
+ size 491882439
Texas7k/data-00428-of-00430.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2264995a1d5faa85698ad55126d239a18305ef607ccf9bc360bab64f1ea49ed1
3
+ size 492086866
Texas7k/data-00429-of-00430.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f20b7c4768579655203966b5ca917b32f4d3550aed25acaabb6595d4c218a75e
3
+ size 494950377
config.toml DELETED
@@ -1,37 +0,0 @@
1
- # Name of the reference PGLib case. Must be a valid PGLib case name.
2
- case_file = "texas7k_case.json"
3
- floating_point_type = "Float32"
4
-
5
- [sampler]
6
- type = "TimeSeries"
7
- h5_path = "texas7k_demand_2020_5min.h5"
8
-
9
- [OPF]
10
-
11
- [OPF.ACOPF]
12
- type = "ACOPF"
13
- solver.name = "Ipopt"
14
- solver.attributes.tol = 1e-6
15
- solver.attributes.linear_solver = "ma27"
16
-
17
- [OPF.DCOPF]
18
- # Formulation/solver options
19
- type = "DCOPF"
20
- solver.name = "HiGHS"
21
-
22
- [OPF.SOCOPF]
23
- type = "SOCOPF"
24
- solver.name = "Clarabel"
25
- # Tight tolerances
26
- solver.attributes.tol_gap_abs = 1e-6
27
- solver.attributes.tol_gap_rel = 1e-6
28
- solver.attributes.tol_feas = 1e-6
29
- solver.attributes.tol_infeas_rel = 1e-6
30
- solver.attributes.tol_ktratio = 1e-6
31
- # Reduced accuracy settings
32
- solver.attributes.reduced_tol_gap_abs = 1e-6
33
- solver.attributes.reduced_tol_gap_rel = 1e-6
34
- solver.attributes.reduced_tol_feas = 1e-6
35
- solver.attributes.reduced_tol_infeas_abs = 1e-6
36
- solver.attributes.reduced_tol_infeas_rel = 1e-6
37
- solver.attributes.reduced_tol_ktratio = 1e-6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
data/ACOPF/dual.h5.gz DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:231290c2ac472f64e12535430e2fdaae791f47096d199c927f1ac06fa8d4a9c3
3
- size 42196194529
 
 
 
 
data/ACOPF/primal.h5.gz DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:27de6cc6f06429bb71235c9428456815e7a7238eaaf33ba01736aae4e6b3f61d
3
- size 18503121017
 
 
 
 
data/DCOPF/dual.h5.gz DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:75749365c55cf1f3bfe90002e7fb80439074fa9f1e6f54f15dbdda654088ffa4
3
- size 4171132625
 
 
 
 
data/DCOPF/primal.h5.gz DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:d3337739353eea477d9953cd38b43d1590efd559f9e8a0fe8f296b5b8da9526b
3
- size 5718185811
 
 
 
 
data/SOCOPF/dual/xaa DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:35cd860ab19d5cebdd3472f9ea405b313901c6d187374749fde7f73221ee135d
3
- size 32212254720
 
 
 
 
data/SOCOPF/dual/xab DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:dd5a5c8587c91cc0f96a24492cd23e096e9fd258ef5840a1fe3c009c857a8590
3
- size 32212254720
 
 
 
 
data/SOCOPF/dual/xac DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:fad980ecbb46791ce64edcb9754656646fdd597850b4920257a0c8cbe48de144
3
- size 25391068036
 
 
 
 
data/SOCOPF/primal.h5.gz DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:07d8a19cdfedfe59cbdaf67ea45da05f49efcd7dfe314d0042b7d9f2ed76d60f
3
- size 22702542416
 
 
 
 
data/input.h5.gz DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:b56929a6dcba6b5f86871385d96793891152d11710e243b6179a866f30294a11
3
- size 3499977402