diff --git a/swash/config.ini b/swash/config.ini index 560cfa6..657a41b 100644 --- a/swash/config.ini +++ b/swash/config.ini @@ -12,6 +12,7 @@ out=out_data out_nb=out_data_nb [swash] +nb=True input=sws/INPUT.sws path=/opt/swash out=out_sws diff --git a/swash/processing/swash.py b/swash/processing/swash.py index d73cce8..c86a769 100644 --- a/swash/processing/swash.py +++ b/swash/processing/swash.py @@ -30,8 +30,12 @@ with tempfile.TemporaryDirectory(prefix="swash_", dir=".") as tmp_raw: log.info(f"Copying files to '{tmpdir}'") shutil.copy2(inp, tmpdir) + if config.getboolean("swash", "nb", fallback=False): + path = pathlib.Path(config.get("data", "out_nb")) + else: + path = pathlib.Path(config.get("data", "out")) shutil.copytree( - pathlib.Path(config.get("data", "out")), tmpdir, dirs_exist_ok=True + path, tmpdir, dirs_exist_ok=True ) if config.has_option("swash", "mpi"):