1
Fork 0

Changed output directories

This commit is contained in:
Edgar P. Burkhart 2022-03-03 10:58:49 +01:00
parent 588318e4ce
commit 420b9cfd4f
Signed by: edpibu
GPG key ID: 9833D3C5A25BD227
5 changed files with 6 additions and 9 deletions

1
swash/.gitignore vendored
View file

@ -1,3 +1,2 @@
/cache
/out*
/swash_buoytoartha

View file

@ -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

View file

@ -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=" ")

View file

@ -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")

View file

@ -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(