From 5479aaa44c3e365cdb976a87132e4d99a6ac882b Mon Sep 17 00:00:00 2001 From: Steve Goldman Date: Fri, 2 Oct 2020 11:17:34 -0400 Subject: [PATCH] Added code to remove output directory from previous run. --- metal_small/run_beast.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/metal_small/run_beast.py b/metal_small/run_beast.py index 4f1727b..ba7ab3a 100755 --- a/metal_small/run_beast.py +++ b/metal_small/run_beast.py @@ -5,6 +5,8 @@ # system imports import argparse +import shutil +from glob import glob # BEAST imports from beast.tools.run import ( @@ -55,6 +57,12 @@ # read in BEAST settings settings = beast_settings.beast_settings("beast_settings.txt") + # remove output files from previous runs + output_dir_path = 'beast_'+os.getcwd().split('/')[-1] + if os.path.isdir(output_dir_path): + shutil.rmtree(output_dir_path) + + if args.physicsmodel: create_physicsmodel.create_physicsmodel(