From c4c751721b5ca2dba614baeb80b45eed16bb48f6 Mon Sep 17 00:00:00 2001 From: "Edgar P. Burkhart" Date: Mon, 7 Mar 2022 12:42:11 +0100 Subject: [PATCH] Add swash model nobreakwater --- swash/config.ini | 1 + swash/processing/swash.py | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) 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"):