diff --git a/swash/.gitignore b/swash/.gitignore index c636eb8..2677d7c 100644 --- a/swash/.gitignore +++ b/swash/.gitignore @@ -1,3 +1,2 @@ -/cache /out* /swash_buoytoartha diff --git a/swash/config.ini b/swash/config.ini index ef13eee..4cfce0e 100644 --- a/swash/config.ini +++ b/swash/config.ini @@ -8,11 +8,9 @@ bathy=buoyarthabathy.dat hstru=Hstru.dat poro=Poro.dat psize=Psize.dat - -[out] -root=cache +out=out_data [swash] input=sws/INPUT.sws swashrun=/opt/swash/swash/swashrun -out=out +out=out_swash diff --git a/swash/processing/bathy.py b/swash/processing/bathy.py index b21118a..f2f8cb8 100644 --- a/swash/processing/bathy.py +++ b/swash/processing/bathy.py @@ -62,8 +62,8 @@ log.info( f"n: {bathy.index.size}" ) -if config.has_section("out"): - out = pathlib.Path(config.get("out", "root")) +if config.has_option("data", "out"): + out = pathlib.Path(config.get("data", "out")) log.info(f"Writing output data to '{out}'") out.mkdir(exist_ok=True) np.savetxt(out.joinpath("bathy.dat"), bathy.z, newline=" ") diff --git a/swash/processing/post.py b/swash/processing/post.py index a9f6cb5..a1183eb 100644 --- a/swash/processing/post.py +++ b/swash/processing/post.py @@ -12,7 +12,7 @@ from .read_swash import * config = configparser.ConfigParser() config.read("config.ini") -cache = pathlib.Path(config.get("out", "root")) +cache = pathlib.Path(config.get("data", "out")) root = pathlib.Path(config.get("swash", "out")) bathy = pd.read_hdf(cache.joinpath("bathy.h5"), "bathy") diff --git a/swash/processing/swash.py b/swash/processing/swash.py index 3c4208d..e4f58d7 100644 --- a/swash/processing/swash.py +++ b/swash/processing/swash.py @@ -16,7 +16,7 @@ with tempfile.TemporaryDirectory(prefix="swash_", dir=".") as tmp_raw: shutil.copy2(inp, tmpdir) shutil.copytree( - pathlib.Path(config.get("out", "root")), tmpdir, dirs_exist_ok=True + pathlib.Path(config.get("data", "out")), tmpdir, dirs_exist_ok=True ) subprocess.run(