Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/xarray_regrid/regrid.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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)

Expand Down
7 changes: 3 additions & 4 deletions src/xarray_regrid/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand Down Expand Up @@ -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(
Expand Down