Changed output directories
This commit is contained in:
parent
588318e4ce
commit
420b9cfd4f
5 changed files with 6 additions and 9 deletions
1
swash/.gitignore
vendored
1
swash/.gitignore
vendored
|
@ -1,3 +1,2 @@
|
||||||
/cache
|
|
||||||
/out*
|
/out*
|
||||||
/swash_buoytoartha
|
/swash_buoytoartha
|
||||||
|
|
|
@ -8,11 +8,9 @@ bathy=buoyarthabathy.dat
|
||||||
hstru=Hstru.dat
|
hstru=Hstru.dat
|
||||||
poro=Poro.dat
|
poro=Poro.dat
|
||||||
psize=Psize.dat
|
psize=Psize.dat
|
||||||
|
out=out_data
|
||||||
[out]
|
|
||||||
root=cache
|
|
||||||
|
|
||||||
[swash]
|
[swash]
|
||||||
input=sws/INPUT.sws
|
input=sws/INPUT.sws
|
||||||
swashrun=/opt/swash/swash/swashrun
|
swashrun=/opt/swash/swash/swashrun
|
||||||
out=out
|
out=out_swash
|
||||||
|
|
|
@ -62,8 +62,8 @@ log.info(
|
||||||
f"n: {bathy.index.size}"
|
f"n: {bathy.index.size}"
|
||||||
)
|
)
|
||||||
|
|
||||||
if config.has_section("out"):
|
if config.has_option("data", "out"):
|
||||||
out = pathlib.Path(config.get("out", "root"))
|
out = pathlib.Path(config.get("data", "out"))
|
||||||
log.info(f"Writing output data to '{out}'")
|
log.info(f"Writing output data to '{out}'")
|
||||||
out.mkdir(exist_ok=True)
|
out.mkdir(exist_ok=True)
|
||||||
np.savetxt(out.joinpath("bathy.dat"), bathy.z, newline=" ")
|
np.savetxt(out.joinpath("bathy.dat"), bathy.z, newline=" ")
|
||||||
|
|
|
@ -12,7 +12,7 @@ from .read_swash import *
|
||||||
config = configparser.ConfigParser()
|
config = configparser.ConfigParser()
|
||||||
config.read("config.ini")
|
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"))
|
root = pathlib.Path(config.get("swash", "out"))
|
||||||
|
|
||||||
bathy = pd.read_hdf(cache.joinpath("bathy.h5"), "bathy")
|
bathy = pd.read_hdf(cache.joinpath("bathy.h5"), "bathy")
|
||||||
|
|
|
@ -16,7 +16,7 @@ with tempfile.TemporaryDirectory(prefix="swash_", dir=".") as tmp_raw:
|
||||||
|
|
||||||
shutil.copy2(inp, tmpdir)
|
shutil.copy2(inp, tmpdir)
|
||||||
shutil.copytree(
|
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(
|
subprocess.run(
|
||||||
|
|
Loading…
Reference in a new issue