EridanusQ commited on
Commit
854c968
·
1 Parent(s): 41b556c

update dataset repository README

Browse files
Files changed (1) hide show
  1. README.md +83 -136
README.md CHANGED
@@ -4,6 +4,7 @@ task_categories:
4
  - other
5
  language:
6
  - en
 
7
  tags:
8
  - mixed-integer-programming
9
  - power-systems
@@ -12,189 +13,135 @@ tags:
12
  - mps
13
  - benchmark
14
  size_categories:
15
- - 10K<n<100K
16
-
17
  ---
18
 
19
- # UnitCommitment Trajectory MPS 数据集
20
-
21
- 本仓库用于从 UnitCommitment.jl 的 Matpower 机组组合(UC)实例生成标准 `.mps` 文件,供混合整数规划(MIP)、机组组合(UC)及安全约束机组组合(SCUC)模型求解器测试与基准研究使用。
22
-
23
- 仓库地址:[EridanusQ/UnitCommitment_Trajectory · Datasets at Hugging Face](https://huggingface.co/datasets/EridanusQ/UnitCommitment_Trajectory)
24
-
25
- ## 1. 数据规模
26
-
27
- `UnitCommitment_Trajectory_Test/instances/matpower` 下共有 **26** 个 Matpower case,**9487** 个 `.json.gz` 输入实例。每个实例生成 4 个 `.mps`,全量输出预计 **37948** 个文件。
28
-
29
- | Case | 输入实例数 |
30
- | :-------------- | ---------: |
31
- | case118 | 365 |
32
- | case1354pegase | 365 |
33
- | case13659pegase | 365 |
34
- | case14 | 365 |
35
- | case1888rte | 365 |
36
- | case1951rte | 365 |
37
- | case2383wp | 365 |
38
- | case2736sp | 365 |
39
- | case2737sop | 365 |
40
- | case2746wop | 365 |
41
- | case2746wp | 365 |
42
- | case2848rte | 365 |
43
- | case2868rte | 365 |
44
- | case2869pegase | 365 |
45
- | case30 | 365 |
46
- | case300 | 365 |
47
- | case3012wp | 365 |
48
- | case3120sp | 365 |
49
- | case3375wp | 365 |
50
- | case57 | 362 |
51
- | case6468rte | 365 |
52
- | case6470rte | 365 |
53
- | case6495rte | 365 |
54
- | case6515rte | 365 |
55
- | case89pegase | 365 |
56
- | case9241pegase | 365 |
57
-
58
- ## 2. 目录结构
59
-
60
- ```text
61
- UnitCommitment_Trajectory/
62
- ├── README.md
63
- ├── UnitCommitment_Trajectory_Test/
64
- │ ├── Project.toml
65
- │ ├── Manifest.toml
66
- │ ├── generate_dataset.jl # 批量生成 MPS 主脚本
67
- │ ├── create_scuc_mps_files.jl # 单算例调试脚本
68
- │ ├── instances/
69
- │ │ └── matpower/ # 原始 .json.gz 输入实例
70
- │ ├── benchmark/
71
- │ │ └── scripts/
72
- │ │ └── download_matpower_instances.py
73
- │ ├── src/ # 修改版 UnitCommitment.jl 源码
74
- │ └── ...
75
- └── UnitCommitment_Trajectory_Dataset/ # 输出的 .mps 文件目录
76
- ```
77
-
78
- > 后文所有命令均在 `UnitCommitment_Trajectory_Test` 目录下执行,路径均相对于该目录。
79
-
80
- ## 3. 环境准备
81
 
82
- - **Julia**:建议 1.12 系列。
83
- - **Python 3**:仅用于下载脚本,无需额外依赖。
84
 
85
- ```powershell
86
- cd UnitCommitment_Trajectory\UnitCommitment_Trajectory_Test
87
- julia --project=. -e "using Pkg; Pkg.instantiate()"
88
- ```
89
-
90
- ## 4. 下载原始 Matpower 输入数据
91
 
92
- 下载脚本 `benchmark\scripts\download_matpower_instances.py` 从 `https://axavier.org/UnitCommitment.jl/0.4/instances` 获取数据,默认日期范围 `2017-01-01` 至 `2017-12-31`,保存到 `instances/matpower`,已存在且非空的文件会自动跳过。
 
 
 
 
 
 
 
 
 
93
 
94
- ```powershell
95
- # 下载全年数据(最常用)
96
- python benchmark\scripts\download_matpower_instances.py
97
 
98
- # 查看支持的 case 列表
99
- python benchmark\scripts\download_matpower_instances.py --list-cases
100
 
101
- # 指定日期范围(示例)
102
- python benchmark\scripts\download_matpower_instances.py --start-date 2017-01-01 --end-date 2017-01-31
103
- ```
 
 
104
 
105
- 快速检查下载结果:
106
 
107
- ```powershell
108
- Get-ChildItem instances\matpower -Recurse -Filter *.json.gz | Measure-Object
 
 
109
  ```
110
 
111
- ## 5. MPS 输出结构
112
 
113
- `generate_dataset.jl` 将结果输出到 `../UnitCommitment_Trajectory_Dataset`(即仓库根目录下的数据集目录)。每个 case 下生成四个变体子目录:
114
 
115
  ```text
116
  case_name/
117
- ├── hourly_noline/ # 小时级 UC,无线路约束
118
- ├── hourly_withline/ # 小时级 SCUC,含线路约束
119
- ├── subhourly_noline/ # 子小时 UC,无线路约束
120
- └── subhourly_withline/ # 子小时 SCUC,含线路约束
121
  ```
122
 
123
- 文件命名规则:`{case}_{date}_{resolution}_{network}.mps`
124
- 例如:`case30_2017-01-01_h_noline.mps`(`h` = hourly,`s` = subhourly)。
125
 
126
- ## 6. 单算例测试
 
 
 
 
 
127
 
128
- 用于验证环境与建模流程是否正常:
129
 
130
- ```powershell
131
- julia --project=. create_scuc_mps_files.jl
132
  ```
133
 
134
- 成功后会在当前目录生成四个测试文件:`uc_default_noline.mps` 等。
 
 
 
 
 
 
135
 
136
- ## 7. 全量生成 MPS 数据集
137
 
138
- ### 7.1 基本用法
139
 
140
- 确认输入数据就绪后,直接运行:
141
 
142
  ```powershell
143
- julia --project=. generate_dataset.jl
 
 
 
 
144
  ```
145
 
146
- 脚本会自动扫描 `instances/matpower` 下所有包含 `.json.gz` case。**全量生成非常耗时且占用大量磁盘空间**,大规模 case(如 `case13659pegase`、`case9241pegase`)尤为突出。
147
 
148
- ### 7.2 只生成指定 Case
149
 
150
  ```powershell
151
- $env:UC_CASES = "case3375wp,case9241pegase,c6515rte"
152
- julia --project=. generate_dataset.jl
153
- Remove-Item Env:\UC_CASES
154
  ```
155
 
156
- case 同理:`$env:UC_CASES = "case118"`。干跑与指定 case 可组合使用。
157
-
158
- ## 8. 检查 MPS 输出结果
159
-
160
- 在 `UnitCommitment_Trajectory_Test` 目录下执行:
161
 
162
  ```powershell
163
- # 文件总数
164
- Get-ChildItem ..\UnitCommitment_Trajectory_Dataset -Recurse -Filter *.mps | Measure-Object
165
  ```
166
 
167
- ## 9. 完整复现流程
168
 
169
- ```powershell
170
- cd UnitCommitment_Trajectory\UnitCommitment_Trajectory_Test
171
 
172
- # 1. 初始化 Julia 环境
173
- julia --project=. -e "using Pkg; Pkg.instantiate()"
174
 
175
- # 2. 下载 Matpower 实例
176
- python benchmark\scripts\download_matpower_instances.py
 
 
 
177
 
178
- # 3. 检查下载数量
179
- Get-ChildItem instances\matpower -Recurse -Filter *.json.gz | Measure-Object
180
 
181
- # 4. 全量生成 MPS
182
- julia --project=. generate_dataset.jl
183
-
184
- # 5. 检查最终 MPS 文件数
185
- Get-ChildItem ..\UnitCommitment_Trajectory_Dataset -Recurse -Filter *.mps | Measure-Object
186
- ```
187
 
188
- ## 10. 轨迹约束与预处理说明
189
 
190
- 本仓库基于修改版 UnitCommitment.jl,增加了启停轨迹约束与实例预处理逻辑。相关代码位于:
 
 
 
191
 
192
- - `src/model/formulations`:轨迹约束建模
193
- - `src/instance/modify.jl`:实例预处理
194
 
195
- 更详细的说明与测试示例参见 `UnitCommitment_Trajectory_Test/README.md`。
196
 
197
- ## 11. 引用
198
 
199
- 原始 UnitCommitment.jl DOI:
200
- [10.5281/zenodo.4269874](https://doi.org/10.5281/zenodo.4269874)
 
4
  - other
5
  language:
6
  - en
7
+ - zh
8
  tags:
9
  - mixed-integer-programming
10
  - power-systems
 
13
  - mps
14
  - benchmark
15
  size_categories:
16
+ - 1K<n<10K
 
17
  ---
18
 
19
+ # UnitCommitment Trajectory Dataset
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
20
 
21
+ This repository stores generated Unit Commitment trajectory benchmark data.
 
22
 
23
+ The project is split into two repositories:
 
 
 
 
 
24
 
25
+ - Code repository: `EridanusQ/UnitCommitment_Trajectory`
26
+ - generation scripts
27
+ - modified UnitCommitment.jl source code
28
+ - Matpower instance download and preprocessing workflow
29
+ - documentation for reproducing the MPS generation process
30
+ - Dataset repository: `EridanusQ/UnitCommitment_Trajectory_Dataset`
31
+ - this Hugging Face Dataset repository
32
+ - generated `.mps` benchmark files
33
+ - one data case per Git branch
34
+ - each branch stores the case as a compressed `.tar.gz` archive
35
 
36
+ ## Repository Layout
 
 
37
 
38
+ The `main` branch is the landing page for the dataset repository. Data are stored on separate branches.
 
39
 
40
+ | Branch | Archive | Contents |
41
+ | --- | --- | --- |
42
+ | `case3375wp` | `case3375wp.tar.gz` | Generated MPS files for `case3375wp` |
43
+ | `case6515rte` | `case6515rte.tar.gz` | Generated MPS files for `case6515rte` |
44
+ | `case9241pegase` | `case9241pegase.tar.gz` | Generated MPS files for `case9241pegase` |
45
 
46
+ More case branches can be added using the same convention:
47
 
48
+ ```text
49
+ branch name: <case_name>
50
+ archive name: <case_name>.tar.gz
51
+ archive root: <case_name>/
52
  ```
53
 
54
+ ## Archive Contents
55
 
56
+ After extracting a case archive, the directory structure is:
57
 
58
  ```text
59
  case_name/
60
+ ├── hourly_noline/
61
+ ├── hourly_withline/
62
+ ├── subhourly_noline/
63
+ └── subhourly_withline/
64
  ```
65
 
66
+ The four variants represent:
 
67
 
68
+ | Directory | Description |
69
+ | --- | --- |
70
+ | `hourly_noline` | Hourly UC instances without transmission line constraints |
71
+ | `hourly_withline` | Hourly SCUC instances with transmission line constraints |
72
+ | `subhourly_noline` | Sub-hourly UC instances without transmission line constraints |
73
+ | `subhourly_withline` | Sub-hourly SCUC instances with transmission line constraints |
74
 
75
+ File names follow:
76
 
77
+ ```text
78
+ <case>_<date>_<resolution>_<network>.mps
79
  ```
80
 
81
+ For example:
82
+
83
+ ```text
84
+ case3375wp_2017-05-01_s_withline.mps
85
+ case6515rte_2017-08-01_h_noline.mps
86
+ case9241pegase_2017-02-25_h_noline.mps
87
+ ```
88
 
89
+ where `h` means hourly and `s` means sub-hourly.
90
 
91
+ ## Download
92
 
93
+ ### Download With Hugging Face CLI
94
 
95
  ```powershell
96
+ huggingface-cli download EridanusQ/UnitCommitment_Trajectory_Dataset `
97
+ case3375wp.tar.gz `
98
+ --repo-type dataset `
99
+ --revision case3375wp `
100
+ --local-dir data/case3375wp
101
  ```
102
 
103
+ Replace `case3375wp` with the target branch/case name.
104
 
105
+ ### Download With Git LFS
106
 
107
  ```powershell
108
+ git lfs install
109
+ git clone -b case3375wp https://huggingface.co/datasets/EridanusQ/UnitCommitment_Trajectory_Dataset
 
110
  ```
111
 
112
+ Then extract the archive:
 
 
 
 
113
 
114
  ```powershell
115
+ tar -xzf case3375wp.tar.gz
 
116
  ```
117
 
118
+ ## Dataset Generation
119
 
120
+ The generated data come from Matpower Unit Commitment instances and are exported as standard `.mps` files for mixed-integer programming solver benchmarking.
 
121
 
122
+ The generation workflow is maintained in the separate code repository, not in this dataset repository. Please use the code repository for:
 
123
 
124
+ - environment setup
125
+ - downloading source Matpower instances
126
+ - modifying or inspecting UnitCommitment.jl model code
127
+ - regenerating MPS files
128
+ - reproducing the trajectory constraints and preprocessing logic
129
 
130
+ This dataset repository is intended to be lightweight to browse: each branch contains only the compressed generated output for one case.
 
131
 
132
+ ## Storage Policy
 
 
 
 
 
133
 
134
+ Do not commit expanded `.mps` directories to this repository. For each case:
135
 
136
+ 1. Generate the case directory locally.
137
+ 2. Compress it as `<case_name>.tar.gz`.
138
+ 3. Commit the archive to the matching branch.
139
+ 4. Track the archive with Git LFS.
140
 
141
+ This keeps each branch easy to download and avoids thousands of large text files in the Git tree.
 
142
 
143
+ ## Citation
144
 
145
+ The original UnitCommitment.jl project is available at:
146
 
147
+ [10.5281/zenodo.4269874](https://doi.org/10.5281/zenodo.4269874)