From 9e39cafb1dd5037edc012285272219c918343b93 Mon Sep 17 00:00:00 2001 From: "Edgar P. Burkhart" Date: Thu, 14 Apr 2022 15:03:56 +0200 Subject: [PATCH] Add support for gunziped file to animate --- olaflow/processing/animate.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/olaflow/processing/animate.py b/olaflow/processing/animate.py index b06adbd..160e573 100644 --- a/olaflow/processing/animate.py +++ b/olaflow/processing/animate.py @@ -27,7 +27,9 @@ config.read(args.config) out = pathlib.Path(config.get("post", "out")) out.mkdir(parents=True, exist_ok=True) -with gzip.open(out.joinpath("pickle.gz"), "rb") as f: +with gzip.open(gzf, "rb") if ( + gzf := out.joinpath("pickle.gz") +).exists() else gzf.with_suffix("").open("rb") as f: model = pickle.load(f) x0 = config.getfloat("post", "x")