Skip to content

Commit 373bd2a

Browse files
authored
use time_dim arg, dont assume time (#62)
1 parent eef312a commit 373bd2a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/xarray_regrid/regrid.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ def validate_input(
292292
time_dim: str | None,
293293
) -> xr.Dataset:
294294
if time_dim is not None and time_dim in ds_target_grid.coords:
295-
ds_target_grid = ds_target_grid.isel(time=0).reset_coords()
295+
ds_target_grid = ds_target_grid.isel({time_dim: 0}).reset_coords()
296296

297297
if len(set(data.dims).intersection(set(ds_target_grid.dims))) == 0:
298298
msg = (

0 commit comments

Comments
 (0)