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}'")
|
||||
rsws = ReadSwash()
|
||||
rsws.read_time(sws_out.joinpath("tsec.dat"))
|
||||
rsws.read_x(sws_out.joinpath("xp.dat"))
|
||||
np.save(inp.joinpath("tsec"), rsws.read_time(sws_out.joinpath("tsec.dat")))
|
||||
np.save(inp.joinpath("xp"), rsws.read_x(sws_out.joinpath("xp.dat")))
|
||||
|
||||
var = {
|
||||
"dep": rsws.read_scalar,
|
||||
|
@ -40,9 +40,10 @@ var = {
|
|||
|
||||
inp.mkdir(exist_ok=True)
|
||||
with Pool() as pool:
|
||||
log.info("Converting all data")
|
||||
pool.map(
|
||||
lambda name, f: np.save(
|
||||
inp.joinpath(name), f(sws_out.joinpath(name).with_suffix(".dat"))
|
||||
lambda x: np.save(
|
||||
inp.joinpath(x[0]), x[1](sws_out.joinpath(x[0]).with_suffix(".dat"))
|
||||
),
|
||||
var.items(),
|
||||
)
|
||||
|
|
Loading…
Reference in a new issue