From 56c5e5c230bcb222b05d9d73c62b486d156b1d2b Mon Sep 17 00:00:00 2001 From: "Edgar P. Burkhart" Date: Fri, 6 May 2022 11:13:54 +0200 Subject: [PATCH] Update pickling for U and graphUniform2 --- olaflow/processing/olaflow.py | 8 ++++---- olaflow/processing/pickle.py | 3 +++ 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/olaflow/processing/olaflow.py b/olaflow/processing/olaflow.py index 30329e8..3dc10c1 100644 --- a/olaflow/processing/olaflow.py +++ b/olaflow/processing/olaflow.py @@ -58,13 +58,13 @@ class OFModel: ) _res_0 = np.loadtxt(_ft(self._t_dirs[0])) _x = _res_0[:, 0] - _res = np.empty((self._t.size, _x.size)) - _res[0] = _res_0[:, 1] + _res = np.empty((self._t.size, _x.size, _res_0.shape[1] - 1)) + _res[0] = _res_0[:, 1:] for _r, _dir in zip(_res[1:], self._t_dirs[1:]): - _r[:] = np.loadtxt(_ft(_dir))[:, 1] + _r[:] = np.loadtxt(_ft(_dir))[:, 1:] _dict = { f"x_{field}": _x, - field: _res, + field: np.squeeze(_res), } if func not in self._post_fields.keys(): self._post_fields[func] = {} diff --git a/olaflow/processing/pickle.py b/olaflow/processing/pickle.py index 4a05cd9..4e4a6ed 100644 --- a/olaflow/processing/pickle.py +++ b/olaflow/processing/pickle.py @@ -47,6 +47,9 @@ model.read_field_all("p_rgh") model.read_field_all("U") model.read_post("graphUniform", "alpha.water") +model.read_post("graphUniform", "U") +model.read_post("graphUniform2", "alpha.water") +model.read_post("graphUniform2", "U") with ( gzip.open(out.joinpath("pickle.gz"), "wb")