Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Most arguments to open_dataset should be keyword only #4080

Closed
shoyer opened this issue May 19, 2020 · 1 comment
Closed

Most arguments to open_dataset should be keyword only #4080

shoyer opened this issue May 19, 2020 · 1 comment

Comments

@shoyer
Copy link
Member

shoyer commented May 19, 2020

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

@mathause
Copy link
Collaborator

Now implemented with #4989

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants