add doctest examples for core xarray APIs
This PR Implements part of the request in issue #6793 by adding simple and runnable doctest-ready examples for a subset of core APIs. Other methods noted in the issue remain out-of-scope for this PR. It also fixes a couple of outdated/broken examples and adds some more See Also links.
New examples were added for some of my favourite methods including:
-
load_dataset -
load_dataarray -
open_dataset -
open_dataarray -
open_groups -
open_mfdataset -
infer_freq -
polyval -
decode_cf -
Dataset.compute -
Dataset.persist -
Dataset.drop_dims -
get_options -
unify_chunks
This PR fixes several outdated or inconsistent doctests: updating the monthly frequency example in save_mfdataset and modernising See Also references.
Happy to adjust formatting (e.g., skip flags, repr looseness, stylistic preferences) based on maintainer feedback.
- [x] References #6793
- [x] Tests added (doctests across multiple modules)
Thank you for opening this pull request! It may take us a few days to respond here, so thank you for being patient. If you have questions, some answers may be found in our contributing guidelines.