xarray-contrib / xarray-tutorial

Xarray Tutorials
https://tutorial.xarray.dev/
Apache License 2.0
166 stars 106 forks source link

Bump to Jupyter Book v1.0 #270

Closed scottyhq closed 2 weeks ago

scottyhq commented 2 weeks ago

Addresses https://github.com/xarray-contrib/xarray-tutorial/issues/241, https://github.com/xarray-contrib/xarray-tutorial/issues/188, #88

Drops sphinx-exercise which seems unmaintained and not compatible with JupyterBook v1

Replaces #242

review-notebook-app[bot] commented 2 weeks ago

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

scottyhq commented 2 weeks ago

Exercises now rendered consistently in website and jupyterlab with gated syntax (https://myst-parser.readthedocs.io/en/latest/syntax/admonitions.html)

::::{admonition} Exercise
:class: tip

Calculate the rolling mean in 5 point bins along both latitude and longitude using
[`rolling(...).reduce`](https://docs.xarray.dev/en/stable/generated/xarray.core.rolling.DataArrayRolling.reduce.html)

:::{admonition} Solution
:class: dropdown

```python
# exactly equivalent to data.rolling(...).mean()
data.rolling(lat=5, lon=5, center=True).reduce(np.mean).plot();

::: ::::



<img width="900" alt="image" src="https://github.com/xarray-contrib/xarray-tutorial/assets/3924836/173702f0-b801-4724-b275-4e9f562dfc81">
github-actions[bot] commented 2 weeks ago

😭 Deploy PR Preview 8dc179be1d55a230536a817d6ed53d08480ad67f failed. Build logs

🤖 By surge-preview