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*
|
||||
/swash_buoytoartha
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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=" ")
|
||||
|
|
|
@ -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")
|
||||
|
|
|
@ -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(
|
||||
|
|
Loading…
Reference in a new issue