From ed46f8e5e8283436fb696b2d1a45f8da0dc40626 Mon Sep 17 00:00:00 2001 From: Francesco Zanetta <62377868+frazane@users.noreply.github.com> Date: Wed, 11 Dec 2024 19:48:10 +0100 Subject: [PATCH] Write output coordinates of RawOutput as floats (#78) * store coordinates as floats * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- src/anemoi/inference/outputs/raw.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/anemoi/inference/outputs/raw.py b/src/anemoi/inference/outputs/raw.py index 7a4ed06..a46ec52 100644 --- a/src/anemoi/inference/outputs/raw.py +++ b/src/anemoi/inference/outputs/raw.py @@ -48,6 +48,8 @@ def write_state(self, state): date = state["date"].strftime(self.strftime) fn_state = f"{self.path}/{self.template.format(date=date)}" restate = {f"field_{key}": val for key, val in state["fields"].items()} - for key in ["date", "longitudes", "latitudes"]: + for key in ["date"]: restate[key] = np.array(state[key], dtype=str) + for key in ["latitudes", "longitudes"]: + restate[key] = np.array(state[key]) np.savez_compressed(fn_state, **restate)