Black reformat + favor non gzip pickle
This commit is contained in:
parent
ec5a503c63
commit
47bf31fb3a
4 changed files with 36 additions and 19 deletions
|
|
@ -29,9 +29,11 @@ config.read(args.config)
|
|||
out = pathlib.Path(config.get("post", "out"))
|
||||
out.mkdir(parents=True, exist_ok=True)
|
||||
|
||||
with gzip.open(gzf, "rb") if (
|
||||
gzf := out.joinpath("pickle.gz")
|
||||
).exists() else gzf.with_suffix("").open("rb") as f:
|
||||
with (
|
||||
path.open("rb")
|
||||
if (path := out.joinpath("pickle")).exists()
|
||||
else gzip.open(path.with_suffix(".gz"), "rb")
|
||||
) as f:
|
||||
model = pickle.load(f)
|
||||
|
||||
x0_conf = config.getfloat("post", "x")
|
||||
|
|
@ -67,10 +69,10 @@ with plt.rc_context(
|
|||
ha = ax1.plot(model.t, U, lw=1)
|
||||
ax1.set(xlabel="t (s)", ylabel="U (m/s)")
|
||||
|
||||
ax2.plot(model.t, P*1e-3, lw=1)
|
||||
ax2.plot(model.t, P * 1e-3, lw=1)
|
||||
ax2.set(xlabel="t (s)", ylabel="P (kPa)")
|
||||
|
||||
ax3.plot(model.t, P_rgh*1e-3, lw=1)
|
||||
ax3.plot(model.t, P_rgh * 1e-3, lw=1)
|
||||
ax3.set(xlabel="t (s)", ylabel="P_rgh (kPa)")
|
||||
|
||||
for a in ax:
|
||||
|
|
@ -81,8 +83,8 @@ with plt.rc_context(
|
|||
list(
|
||||
starmap(lambda x, z: f"x={x:8}m; z={z:8}m", zip(model.x[i0], model.z[i0]))
|
||||
),
|
||||
bbox_to_anchor=(1.05, .5),
|
||||
loc="center left"
|
||||
bbox_to_anchor=(1.05, 0.5),
|
||||
loc="center left",
|
||||
)
|
||||
|
||||
plt.show()
|
||||
|
|
|
|||
Reference in a new issue