Description
open_dataset
has a long list of arguments: xarray.open_dataset(filename_or_obj, group=None, decode_cf=True, mask_and_scale=None, decode_times=True, autoclose=None, concat_characters=True, decode_coords=True, engine=None, chunks=None, lock=None, cache=None, drop_variables=None, backend_kwargs=None, use_cftime=None)
Similarly to the case for pandas (pandas-dev/pandas#27544), it would be nice to make most of these arguments keyword-only, e.g., def open_dataset(filename_or_obj, group, *, ...)
. For consistency, this would also apply to open_dataarray
, decode_cf
, open_mfdataset
, etc.
This would encourage writing readable code when calling open_dataset()
and would allow us to use better organization when adding new arguments (e.g., decode_timedelta
in #4071).
To make this change, we could make use of the deprecate_nonkeyword_arguments
decorator from pandas-dev/pandas#27573