From af3a797dba1398dc387b01357d30bec3c2e8bca4 Mon Sep 17 00:00:00 2001 From: Lewis Blake Date: Tue, 1 Oct 2024 14:12:19 +0000 Subject: [PATCH] check xr.DataArray first --- pyaerocom/colocation/colocated_data.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyaerocom/colocation/colocated_data.py b/pyaerocom/colocation/colocated_data.py index 376ee2d31..e2d983bd1 100644 --- a/pyaerocom/colocation/colocated_data.py +++ b/pyaerocom/colocation/colocated_data.py @@ -40,10 +40,10 @@ def ensure_correct_dimensions(data: xr.DataArray): If a ColocatedData object is created outside of pyaerocom, this checking is needed. This function is used as part of the model validator. """ - shape = data.shape[0] - if not isinstance(data, xr.DataArray): raise ValueError("Could not interpret data") + + shape = data.shape[0] num_dims = len(data.dims) if num_dims not in (2, 3, 4):