File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33# SPDX-License-Identifier: GPL-3.0-only
44
55import pathlib
6+ from shutil import rmtree
67
78
89configfile : "config.yaml"
@@ -88,3 +89,24 @@ rule convert_EWG:
8889 "environment.yaml"
8990 script :
9091 "scripts/convert_pdf_EWG_to_dataframe.py"
92+
93+
94+ rule all :
95+ input :
96+ rules .compile_cost_assumptions .output ,
97+ rules .compile_cost_assumptions_usa .output ,
98+ default_target :True
99+
100+
101+ rule purge :
102+ run :
103+ import builtins
104+
105+ do_purge = builtins .input (
106+ "Do you really want to delete all generated outputs? [y/N] "
107+ )
108+ if do_purge == "y" :
109+ rmtree ("outputs/" , ignore_errors = True )
110+ print ("Purging generated outputs." )
111+ else :
112+ raise Exception (f"Input { do_purge } . Aborting purge." )
Original file line number Diff line number Diff line change @@ -28,6 +28,8 @@ Upcoming Release
2828
2929* Updates the documentation with compile_cost_assumptions_usa.py (https://github.com/PyPSA/technology-data/pull/186)
3030
31+ * Add `purge ` and `all ` rules to clean all generated outputs and regenerate them (https://github.com/PyPSA/technology-data/pull/187)
32+
3133`v0.11.0 <https://github.com/PyPSA/technology-data/releases/tag/v0.11.0 >`__ (24th January 2025)
3234=======================================================================================
3335
You can’t perform that action at this time.
0 commit comments