diff --git a/xpublish_wms/grid.py b/xpublish_wms/grid.py index b0001c8..9893cd6 100644 --- a/xpublish_wms/grid.py +++ b/xpublish_wms/grid.py @@ -100,7 +100,9 @@ def tessellate(self, da: xr.DataArray) -> np.ndarray: """Tessellate the given data array into triangles. Only required for RenderingMode.Triangle""" pass - def sel_lat_lng(self, subset: xr.Dataset, lng, lat, parameters) -> Tuple[xr.Dataset, list, list]: + def sel_lat_lng( + self, subset: xr.Dataset, lng, lat, parameters, + ) -> Tuple[xr.Dataset, list, list]: """Select the given dataset by the given lon/lat and optional elevation""" subset = subset.cf.interp(longitude=lng, latitude=lat) x_axis = [strip_float(subset.cf["longitude"])] @@ -183,7 +185,9 @@ def project(self, da: xr.DataArray, crs: str) -> xr.DataArray: da = da.unify_chunks() return da - def sel_lat_lng(self, subset: xr.Dataset, lng, lat, parameters) -> Tuple[xr.Dataset, list, list]: + def sel_lat_lng( + self, subset: xr.Dataset, lng, lat, parameters, + ) -> Tuple[xr.Dataset, list, list]: topology = self.ds.cf["grid_topology"] merged_ds = None @@ -515,7 +519,9 @@ def tessellate(self, da: xr.DataArray) -> np.ndarray: else: return self._grid.tessellate(da) - def sel_lat_lng(self, subset: xr.Dataset, lng, lat, parameters) -> Tuple[xr.Dataset, list, list]: + def sel_lat_lng( + self, subset: xr.Dataset, lng, lat, parameters, + ) -> Tuple[xr.Dataset, list, list]: if self._grid is None: return None else: diff --git a/xpublish_wms/wms/get_feature_info.py b/xpublish_wms/wms/get_feature_info.py index ce1f94c..c62018d 100644 --- a/xpublish_wms/wms/get_feature_info.py +++ b/xpublish_wms/wms/get_feature_info.py @@ -169,7 +169,9 @@ def get_feature_info(ds: xr.Dataset, query: dict) -> Response: selected_ds = selected_ds.cf.sel(vertical=0, method="nearest") try: - selected_ds, x_axis, y_axis = ds.grid.sel_lat_lng(subset=selected_ds, lng=x_coord[x], lat=y_coord[y], parameters=parameters) + selected_ds, x_axis, y_axis = ds.grid.sel_lat_lng( + subset=selected_ds, lng=x_coord[x], lat=y_coord[y], parameters=parameters, + ) except ValueError: raise HTTPException(500, f"Unsupported grid type: {ds.grid.name}")