Skip to content

Commit

Permalink
Merge pull request #170 from nismod/feature/protect_outputs_keep_inte…
Browse files Browse the repository at this point in the history
…rmediates

Protect outputs and keep intermediates
  • Loading branch information
thomas-fred authored Dec 20, 2023
2 parents 9f41dde + 3ba359c commit 2304f14
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions workflow/rules/exposure/electricity_grid/disruption.smk
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ rule aggregate_per_event_disruption_across_samples:
input:
per_sample = disruption_per_event_sample_files,
output:
all_samples = "{OUTPUT_DIR}/power/by_country/{COUNTRY_ISO_A3}/disruption/{STORM_SET}/pop_affected_by_event.pq",
all_samples = protected("{OUTPUT_DIR}/power/by_country/{COUNTRY_ISO_A3}/disruption/{STORM_SET}/pop_affected_by_event.pq"),
run:
import pandas as pd

Expand Down Expand Up @@ -134,7 +134,7 @@ rule aggregate_per_target_disruption_across_samples:
input:
per_sample = disruption_per_target_sample_files,
output:
all_samples = "{OUTPUT_DIR}/power/by_country/{COUNTRY_ISO_A3}/disruption/{STORM_SET}/pop_affected_by_target.pq",
all_samples = protected("{OUTPUT_DIR}/power/by_country/{COUNTRY_ISO_A3}/disruption/{STORM_SET}/pop_affected_by_target.pq"),
run:
import pandas as pd

Expand Down
4 changes: 2 additions & 2 deletions workflow/rules/exposure/electricity_grid/exposure.smk
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ rule aggregate_per_event_exposure_across_samples:
input:
per_sample = exposure_per_event_sample_files,
output:
all_samples = "{OUTPUT_DIR}/power/by_country/{COUNTRY_ISO_A3}/exposure/{STORM_SET}/length_m_by_event.pq",
all_samples = protected("{OUTPUT_DIR}/power/by_country/{COUNTRY_ISO_A3}/exposure/{STORM_SET}/length_m_by_event.pq"),
run:
import pandas as pd

Expand Down Expand Up @@ -81,7 +81,7 @@ rule aggregate_per_edge_exposure_across_samples:
input:
per_sample = exposure_per_edge_sample_files,
output:
all_samples = "{OUTPUT_DIR}/power/by_country/{COUNTRY_ISO_A3}/exposure/{STORM_SET}/length_m_by_edge.pq",
all_samples = protected("{OUTPUT_DIR}/power/by_country/{COUNTRY_ISO_A3}/exposure/{STORM_SET}/length_m_by_edge.pq"),
run:
import pandas as pd

Expand Down
4 changes: 2 additions & 2 deletions workflow/rules/exposure/electricity_grid/intersection.smk
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,8 @@ rule electricity_grid_damages:
resources:
mem_mb = lambda wildcards: threads_for_country(wildcards) * 1_024 * 2.5
output:
exposure = temp(directory("{OUTPUT_DIR}/power/by_country/{COUNTRY_ISO_A3}/exposure/{STORM_SET}/{SAMPLE}/")),
disruption = temp(directory("{OUTPUT_DIR}/power/by_country/{COUNTRY_ISO_A3}/disruption/{STORM_SET}/{SAMPLE}/")),
exposure = protected(directory("{OUTPUT_DIR}/power/by_country/{COUNTRY_ISO_A3}/exposure/{STORM_SET}/{SAMPLE}/")),
disruption = protected(directory("{OUTPUT_DIR}/power/by_country/{COUNTRY_ISO_A3}/disruption/{STORM_SET}/{SAMPLE}/")),
script:
"../../../scripts/intersect/grid_disruption.py"

Expand Down

0 comments on commit 2304f14

Please sign in to comment.