-
Notifications
You must be signed in to change notification settings - Fork 29
xarray-tutorial improvements #591
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
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
35d945d
Begin tutorial blog post
dcherian c92c9fa
Merge branch 'main' into tutorial
andersy005 6eb1641
Update
dcherian f652c55
more udpates
dcherian e4a87d2
resize images
dcherian c40fc75
Merge branch 'main' into tutorial
andersy005 b1e6756
first pass
scottyhq 2aa872c
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 8e225c8
Merge branch 'main' into tutorial
andersy005 d51590f
FInalize
dcherian 69fe224
title
dcherian File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
--- | ||
title: 'The revamped Xarray tutorial' | ||
date: '2024-05-31' | ||
authors: | ||
- name: Deepak Cherian | ||
github: dcherian | ||
- name: Scott Henderson | ||
github: scottyhq | ||
- name: Jessica Scheick | ||
github: JessicaS11 | ||
- name: Emma Marshall | ||
github: e-marshall | ||
- name: Tom Nicholas | ||
github: TomNicholas | ||
- name: Anderson Banihirwe | ||
github: andersy005 | ||
- name: Negin Sobhani | ||
github: negin513 | ||
- name: Don Setiawan | ||
github: lsetiawan | ||
|
||
summary: 'The Xarray tutorial has received a major upgrade!' | ||
--- | ||
|
||
## TL;DR | ||
|
||
Over the past several years, we have worked to significantly revamp the [Xarray tutorial](https://tutorial.xarray.org). The tutorial material is geared towards both new and seasoned practitioners. Consider using it for your own lecture or workshop! Or sign up for the upcoming [SciPy 2024 Workshop](https://cfp.scipy.org/2024/talk/HHVZ9T/) that we'll be running. | ||
|
||
## Approach | ||
|
||
The [Xarray Tutorial](https://tutorial.xarray.dev) website hosts a curated selection of Jupyter Notebooks that illustrate concepts, common usage patterns, and long-form examples of using Xarray for data analytics. | ||
|
||
We reworked existing material to bite-sized chunks that can be remixed as needed. Rather than organizing material by specific workshops at a top-level, we now organize by topic and then build a learning path for each event. This way future learners can benefit from a guided tour through the material. For example see the [Fundamental](https://tutorial.xarray.dev/overview/fundamental-path/README.html) and [Intermediate](https://tutorial.xarray.dev/overview/intermediate-path/README.html) learning paths that were presented at SciPy 2022 and SciPy 2023 respectively. | ||
|
||
We believe this method of organizing material also lends it self to easy reuse for other tutorial/workshop activities that may not want to work through material in the manner the canonical ordering does. Our hope is that this material will serve as a great starting point for anyone anywhere looking to deliver a Xarray tutorial. | ||
|
||
## Redesigned with Jupyter Book | ||
|
||
We chose to use [Jupyter Book](https://jupyterbook.org/en/stable/intro.html) as a the tool to render a static HTML version of the tutorial website. We think this has worked well, because it allows you to keep small Jupyter Notebooks in a repository while guaranteeing that code in those notebooks can be executed without errors. It also provides nice linking capabilities directly to the Xarray API documentation. Finally, Jupyter Book simply produces a nice-looking, navigable, and searchable website of all the material. See the before/after image: | ||
|
||
<img | ||
src='/posts/tutorial/tutorial-before-after.png' | ||
alt='Tutorial outline before/after' | ||
width='60%' | ||
/> | ||
|
||
We've been particularly happy with the [`jupyterlab-myst` extension](https://github.com/executablebooks/jupyterlab-myst), which extends the basic Markdown rendering with in JupyterLab and ensures Notebooks rendered as a static webpage look identical to an executable notebook in the JupyterLab interface. | ||
|
||
Finally, we think the Xarray Tutorial is a great way to engage new contributors to Open Source Software development. Every Jupyter Book webpage has a GitHub icon dropdown in the upper right hand corner with a 'Open Issue' and 'Suggest Edit' button. This really simplifies the process of community development and we love that during workshops people totally new to the library have made improvements to the content as we run through it. The repository now has over 30 contributors! | ||
|
||
## New and improved material | ||
|
||
In addition to redesigning the layout, we've improved existing material and added a lot of new material focused on intermediate and advanced concepts: | ||
|
||
1. Revamped fundamentals to include material on [indexing](https://tutorial.xarray.dev/fundamentals/02.1_indexing_Basic.html), as well as [alignment & broadcasting](https://tutorial.xarray.dev/fundamentals/02.3_aligning_data_objects.html). | ||
1. All New Intermediate level material: | ||
|
||
- extending Xarray through [accessors](https://tutorial.xarray.dev/advanced/accessors/01_accessor_examples.html); | ||
- a thorough [treatment](https://tutorial.xarray.dev/advanced/apply_ufunc/apply_ufunc.html) of `apply_ufunc` starting from basics; | ||
- a conceptual introduction to Xarray's [Computational Patterns](https://tutorial.xarray.dev/intermediate/01-high-level-computation-patterns.html) including `rolling`, `coarsen` and `GroupBy`; and | ||
- [Advanced, Vectorized, and Boolean indexing](https://tutorial.xarray.dev/intermediate/indexing/indexing.html). | ||
|
||
## Try it out | ||
|
||
The Xarray Tutorial is designed for interactivity, with coding exercises and configuration of one-click free hosted computing environments. At past SciPy workshops we've successfully used [MyBinder.org](https://tutorial.xarray.dev/overview/get-started.html) and [GitHub Codespaces](https://tutorial.xarray.dev/workshops/scipy2023/README.html#github-codespaces) to ensure 100+ attendees can run code examples in JupyterLab. | ||
|
||
## Come contribute | ||
|
||
While a major improvement, this material is clearly a work in progress and could use help from you! | ||
[Contributions](https://tutorial.xarray.dev/CONTRIBUTING.html) are very welcome and could range from fixing typos, to improving the presentation, and even contributing all new material. We are especially interested in expanding the current use-case content to include more examples with datasets from a broad range of scientific domains. Check out [open issues](https://github.com/xarray-contrib/xarray-tutorial/issues) on the repository for ways to contribute! | ||
We can also substantially improve the way this tutorial material is linked to in the main Xarray documentation ([Github issue](https://github.com/pydata/xarray/issues/8008)). | ||
|
||
Come help out! | ||
|
||
## Acknowledgments | ||
|
||
This work was partially supported by NASA's Open Source Tools, Frameworks, and Libraries (OSTFL) | ||
grant 80NSSC22K0345 "Enhancing analysis of NASA data with the open-source Python Xarray Library". |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.