Fixed multiproc
This commit is contained in:
parent
441eec78d4
commit
5a9e5eb5b4
1 changed files with 5 additions and 4 deletions
|
@ -25,8 +25,8 @@ inp = pathlib.Path(config.get("post", "inp"))
|
||||||
|
|
||||||
log.info(f"Reading swash output from '{sws_out}'")
|
log.info(f"Reading swash output from '{sws_out}'")
|
||||||
rsws = ReadSwash()
|
rsws = ReadSwash()
|
||||||
rsws.read_time(sws_out.joinpath("tsec.dat"))
|
np.save(inp.joinpath("tsec"), rsws.read_time(sws_out.joinpath("tsec.dat")))
|
||||||
rsws.read_x(sws_out.joinpath("xp.dat"))
|
np.save(inp.joinpath("xp"), rsws.read_x(sws_out.joinpath("xp.dat")))
|
||||||
|
|
||||||
var = {
|
var = {
|
||||||
"dep": rsws.read_scalar,
|
"dep": rsws.read_scalar,
|
||||||
|
@ -40,9 +40,10 @@ var = {
|
||||||
|
|
||||||
inp.mkdir(exist_ok=True)
|
inp.mkdir(exist_ok=True)
|
||||||
with Pool() as pool:
|
with Pool() as pool:
|
||||||
|
log.info("Converting all data")
|
||||||
pool.map(
|
pool.map(
|
||||||
lambda name, f: np.save(
|
lambda x: np.save(
|
||||||
inp.joinpath(name), f(sws_out.joinpath(name).with_suffix(".dat"))
|
inp.joinpath(x[0]), x[1](sws_out.joinpath(x[0]).with_suffix(".dat"))
|
||||||
),
|
),
|
||||||
var.items(),
|
var.items(),
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in a new issue