diff --git a/.vscode/launch.json b/.vscode/launch.json index 370cbd0..47bb801 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -350,7 +350,9 @@ // File "/src/data/resample.py", line 736, IndexError: index -1 is out of bounds for axis 0 with size 0 // "args": ["-v", "1", "--mission", "2006.338.11", "--noinput", "--no_cleanup" ], // File "/src/data/create_products.py", line 997, in _plot_var AttributeError: 'NoneType' object has no attribute 'get_index' - "args": ["-v", "1", "--mission", "2010.257.00", "--noinput", "--no_cleanup" ], + //"args": ["-v", "1", "--mission", "2010.257.00", "--noinput", "--no_cleanup" ], + // File "/src/data/create_products.py", line 806, ValueError: max() iterable argument is empty + "args": ["-v", "1", "--mission", "2013.079.00", "--noinput", "--no_cleanup" ], }, { diff --git a/src/data/create_products.py b/src/data/create_products.py index c893cb5..3d65a7d 100755 --- a/src/data/create_products.py +++ b/src/data/create_products.py @@ -382,7 +382,7 @@ def _grid_dims(self) -> tuple: "Cannot compute mean longitude for UTM zone calculation, " "longitude data may be empty or contain NaNs", ) - return None, None, None + return np.array([]), np.array([]), xr.DataArray() MAX_LONGITUDE_VALUES = 400 n_subsample = 200 if len(self.ds.cf["longitude"].to_numpy()) > MAX_LONGITUDE_VALUES else 1 lon_sub_intrp = np.interp( @@ -1125,7 +1125,7 @@ def plot_2column(self) -> str: # noqa: C901, PLR0912, PLR0915 self._open_ds() idist, iz, distnav = self._grid_dims() - if idist is None or iz is None or distnav is None: + if idist.size == 0 or iz.size == 0 or distnav.size == 0: self.logger.warning("Skipping plot_2column due to missing gridding dimensions") return None