File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -58,6 +58,7 @@ def aoh_species_inputs(wildcards):
5858 "habitat_sentinel" : ancient (
5959 DATADIR / "habitat_layers" / SCENARIO / ".habitat_complete"
6060 ),
61+ "lcc_0" : DATADIR / "habitat_layers" / SCENARIO / "lcc_0.tif" ,
6162 "crosswalk" : DATADIR / "crosswalk.csv" ,
6263 "mask" : ancient (DATADIR / "masks" / "CGLS100Inland_withGADMIslands.tif" ),
6364 "elevation_max" : ancient (DATADIR / config ["inputs" ]["zenodo_elevation_max" ]),
Original file line number Diff line number Diff line change @@ -135,33 +135,3 @@ rule copy_islands_layer:
135135 """
136136 cp {input.islands} {output.lcc_0} 2>&1 | tee {log}
137137 """
138-
139-
140- # =============================================================================
141- # Helper rule to get specific habitat layer
142- # =============================================================================
143-
144-
145- def get_habitat_layer (wildcards ):
146- """
147- Returns the path to a specific habitat layer.
148- lcc_0 is special (islands layer), others come from habitat processing.
149- """
150- n = int (wildcards .n )
151- if n == 0 :
152- return DATADIR / "habitat_layers" / SCENARIO / "lcc_0.tif"
153- else :
154- return DATADIR / "habitat_layers" / SCENARIO / f"lcc_{ n } .tif"
155-
156-
157- rule habitat_layer :
158- """
159- Pseudo-rule to request a specific habitat layer.
160- This triggers either the habitat processing or islands copy as needed.
161- """
162- input :
163- layer = get_habitat_layer ,
164- output :
165- # This is a bit of a trick - we declare the output but let the
166- # upstream rules actually create it
167- touch (DATADIR / "habitat_layers" / SCENARIO / ".lcc_{n}_exists" ),
You can’t perform that action at this time.
0 commit comments