Skip to content

Commit 8d1af3b

Browse files
authored
Support more functions. (#62)
untested but we can fix errors as they come up.
1 parent e63a3c7 commit 8d1af3b

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

cf_xarray/accessor.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -297,11 +297,19 @@ def _get_measure(da: Union[DataArray, Dataset], key: str) -> List[str]:
297297
_DEFAULT_KEY_MAPPERS: Mapping[str, Tuple[Mapper, ...]] = {
298298
"dim": (_get_axis_coord,),
299299
"dims": (_get_axis_coord,), # transpose
300+
"dimensions": (_get_axis_coord,), # stack
301+
"dims_dict": (_get_axis_coord,), # swap_dims, rename_dims
302+
"shifts": (_get_axis_coord,), # shift, roll
303+
"pad_width": (_get_axis_coord,), # shift, roll
304+
# "names": something_with_all_valid_keys? # set_coords, reset_coords
300305
"coords": (_get_axis_coord,), # interp
301-
"indexers": (_get_axis_coord,), # sel, isel
306+
"indexers": (_get_axis_coord,), # sel, isel, reindex
307+
# "indexes": (_get_axis_coord,), # set_index
302308
"dims_or_levels": (_get_axis_coord,), # reset_index
303-
"coord": (_get_axis_coord_single,),
309+
"window": (_get_axis_coord,), # rolling_exp
310+
"coord": (_get_axis_coord_single,), # differentiate, integrate
304311
"group": (_get_axis_coord_single,),
312+
"indexer": (_get_axis_coord_single,), # resample
305313
"variables": (_get_axis_coord,), # sortby
306314
"weights": (_get_measure_variable,), # type: ignore
307315
}

0 commit comments

Comments
 (0)