diff --git a/src/xarray_regrid/regrid.py b/src/xarray_regrid/regrid.py index b2ed389..d34eb72 100644 --- a/src/xarray_regrid/regrid.py +++ b/src/xarray_regrid/regrid.py @@ -164,10 +164,10 @@ def most_common( if isinstance(self._obj, xr.Dataset): msg = ( - "The 'most common value' regridder is not implemented for\n", + "The 'most common value' regridder is not implemented for\n" "xarray.Dataset, as it requires specifying the expected labels.\n" "Please select only a single variable (as DataArray),\n" - " and regrid it separately.", + " and regrid it separately." ) raise ValueError(msg) @@ -216,10 +216,10 @@ def least_common( if isinstance(self._obj, xr.Dataset): msg = ( - "The 'least common value' regridder is not implemented for\n", + "The 'least common value' regridder is not implemented for\n" "xarray.Dataset, as it requires specifying the expected labels.\n" "Please select only a single variable (as DataArray),\n" - " and regrid it separately.", + " and regrid it separately." ) raise ValueError(msg) diff --git a/src/xarray_regrid/utils.py b/src/xarray_regrid/utils.py index 6979f84..0e4d2db 100644 --- a/src/xarray_regrid/utils.py +++ b/src/xarray_regrid/utils.py @@ -31,11 +31,10 @@ def __post_init__(self) -> None: msg = None if self.south > self.north: msg = ( - "Value of north bound is greater than south bound." + "Value of south bound is greater than north bound." "\nPlease check the bounds input." ) - pass - if self.west > self.east: + elif self.west > self.east: msg = ( "Value of west bound is greater than east bound." "\nPlease check the bounds input." @@ -80,7 +79,7 @@ def create_lat_lon_coords(grid: Grid) -> tuple[np.ndarray, np.ndarray]: grid.south, grid.north + grid.resolution_lat, grid.resolution_lat ) - if np.remainder((grid.east - grid.west), grid.resolution_lat) > 0: + if np.remainder((grid.east - grid.west), grid.resolution_lon) > 0: lon_coords = np.arange(grid.west, grid.east, grid.resolution_lon) else: lon_coords = np.arange(