--- license: cc-by-sa-4.0 tags: - energy - optimization - optimal_power_flow - power_grid pretty_name: PGLearn Optimal Power Flow (small) size_categories: - 1M find ./ -type f -name "*.gz" -exec unpigz -v {} + ``` ### Downloading individual files The entire PGLearn-Small collection takes about 180GB of disk space (compressed). To avoid large disk usage and long download times, it is possible to download only a subset of the files. This approach is recommended for users who only require a subset of the dataset, for instance: * a subset of cases * a specific OPF formulation (e.g. only ACOPF) * only primal solutions (as opposed to primal and dual) This can be achieved by using the `allow_patterns` and `ignore_patterns` parameters (see [official documentation](https://huggingface.co/docs/huggingface_hub/guides/download#filter-files-to-download)), in lieu of step 2. above. * To download only the `14_ieee` and `30_ieee` cases: ```py REPO_ID = "PGLearn/PGLearn-Small" CASES = ["14_ieee", "30_ieee"] LOCAL_DIR = "" snapshot_download(repo_id=REPO_ID, allow_patterns=[f"{case}/" for case in CASES], repo_type="dataset", local_dir=LOCAL_DIR) ``` * To download a specific OPF formulation (the repository structure makes it simpler to exclude non-desired OPF formulations) ```py REPO_ID = "PGLearn/PGLearn-Small" ALL_OPFS = ["ACOPF", "DCOPF", "SOCOPF"] SELECTED_OPFS = ["ACOPF", "DCOPF"] LOCAL_DIR = "" snapshot_download(repo_id=REPO_ID, ignore_patterns=[f"*/{opf}/*" for opf in ALL_OPFS if opf not in SELECTED_OPFS], repo_type="dataset", local_dir=LOCAL_DIR) ``` * To download only primal solutions ```py REPO_ID = "PGLearn/PGLearn-Small" LOCAL_DIR = "" snapshot_download(repo_id=REPO_ID, ignore_patterns="*dual.h5.gz", repo_type="dataset", local_dir=LOCAL_DIR) ``` ## Contents For each system (e.g., `14_ieee`, `118_ieee`), the dataset provides multiple OPF instances, and corresponding primal and dual solutions for the following OPF formulations * AC-OPF (nonlinear, non-convex) * DC-OPF approximation (linear, convex) * Second-Order Cone (SOC) relaxation of AC-OPF (nonlinear, convex) This dataset was created using [OPFGenerator](https://github.com/AI4OPT/OPFGenerator); please see the [OPFGenerator documentation](https://ai4opt.github.io/OPFGenerator/dev/) for details on mathematical formulations. ## Use cases The primary intended use case of this dataset is to learn a mapping from input data to primal and/or dual solutions.