Skip to content

Commit

Permalink
Merge pull request #71 from nesi/dini-dev
Browse files Browse the repository at this point in the history
update output directories for each snakefile
  • Loading branch information
DininduSenanayake authored Oct 14, 2024
2 parents f4ba466 + 5f6e6b4 commit bf73c1c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
10 changes: 7 additions & 3 deletions 08-snakemake/Snakefile_apsimx
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,20 @@ rule create_logdir:
output:
directory(config["slurm_logdir"])
shell:
"mkdir -p {output}"
"""
mkdir -p {output}
mkdir -p PASSED_DB
mkdir -p FAILED_DB
"""

rule sort_db_files:
input:
expand("{file}.processed", file=[os.path.splitext(f)[0] for f in apsimx_files])
output:
"db_files_sorted"
run:
passed_dir = "PASSED"
failed_dir = "FAILED"
passed_dir = "PASSED_DB"
failed_dir = "FAILED_DB"
os.makedirs(passed_dir, exist_ok=True)
os.makedirs(failed_dir, exist_ok=True)

Expand Down
6 changes: 3 additions & 3 deletions 08-snakemake/Snakefile_txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ rule process_txt_files:
export APPTAINER_BIND="{config[apptainer_bind]}"
export APPTAINER_CMD="apptainer exec {config[apptainer_image]}"

mkdir -p FAILED
mkdir -p FAILED_CONFIG
consecutive_failures=0
max_consecutive_failures={config[max_consecutive_failures]}

Expand All @@ -45,7 +45,7 @@ rule process_txt_files:
consecutive_failures=0
else
echo "Failed to process $file"
mv "$file" FAILED/
mv "$file" FAILED_CONFIG/
((consecutive_failures++))

if [ $consecutive_failures -ge $max_consecutive_failures ]; then
Expand All @@ -62,4 +62,4 @@ rule create_logdir:
output:
directory(config["slurm_logdir"])
shell:
"mkdir -p {output}"
"mkdir -p {output}"

0 comments on commit bf73c1c

Please sign in to comment.