Skip to content

Commit

Permalink
local malaria figure, update default links
Browse files Browse the repository at this point in the history
  • Loading branch information
scottyhq committed Jul 8, 2024
1 parent 5d2f3dd commit b92ea70
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 31 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/scipy2024/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
},
"customizations": {
"codespaces": {
"openFiles": ["workshops/scipy2024/README.md"]
"openFiles": ["workshops/scipy2024/index.ipynb"]
},
"vscode": {
"extensions": ["ms-toolsai.jupyter", "ms-python.python"]
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[![CI](https://github.com/xarray-contrib/xarray-tutorial/workflows/CI/badge.svg?branch=main)](https://github.com/xarray-contrib/xarray-tutorial/actions?query=branch%3Amain)
[![Jupyter Book Badge](https://jupyterbook.org/badge.svg)](https://tutorial.xarray.dev)
[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/xarray-contrib/xarray-tutorial/HEAD?labpath=overview/fundamental-path/index.ipynb)
[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/xarray-contrib/xarray-tutorial/HEAD?labpath=workshops/scipy2024/index.ipynb)

This is the repository for a Jupyter Book website with tutorial material for [Xarray](https://github.com/pydata/xarray), _an open source project and Python package that makes working with labelled multi-dimensional arrays simple, efficient, and fun!_

Expand Down
2 changes: 1 addition & 1 deletion fundamentals/01_data_structures.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ powerful and concise interface. For example:

Although the Xarray library was originally developed with Earth Science datasets in mind, the datastructures work well across many other domains! For example, below is a side-by-side view of a data schematic on the left and Xarray Dataset representation on the right taken from a mosquito genetics analysis:

<img src="https://vobs-resources.cog.sanger.ac.uk/training/img/workshop-4/mosquito-genotype-array.png" align="center" width="80%">
![malaria_dataset](../images/malaria_dataset.png)

The data can be stored as a 3-dimensional array, where one dimension of the array corresponds to positions (**variants**) within a reference genome, another dimension corresponds to the individual mosquitoes that were sequenced (**samples**), and a third dimension corresponds to the number of genomes within each individual (**ploidy**)."

Expand Down
27 changes: 10 additions & 17 deletions fundamentals/01_datastructures.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,12 @@
"source": [
"# Xarray's Data structures\n",
"\n",
"In this lesson, we cover the basics of Xarray data structures. Our\n",
"learning goals are as follows. By the end of the lesson, we will be able to:\n",
"In this lesson, we cover the basics of Xarray data structures. By the end of the lesson, we will be able to:\n",
"\n",
":::{admonition} Learning Goals\n",
"- Understand the basic data structures (`DataArray` and `Dataset` objects) in Xarray\n",
"- Customize the display of Xarray objects\n",
"- Access variables, coordinates, and arbitrary metadata\n",
"- Transform to tabular Pandas data structures\n",
"- Understand the basic Xarray data structures `DataArray` and `Dataset` \n",
"- Customize the display of Xarray data structures\n",
"- The connection between Pandas and Xarray data structures\n",
":::"
]
},
Expand Down Expand Up @@ -130,18 +128,13 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"The output consists of:\n",
"☝️ From top to bottom the output consists of:\n",
"\n",
"- a summary of all *dimensions* of the `Dataset` `(lat: 25, time: 2920, lon: 53)`: this tells us that the first\n",
" dimension is named `lat` and has a size of `25`, the second dimension is named\n",
" `time` and has a size of `2920`, and the third dimension is named `lon` and has a size\n",
" of `53`. Because we will access the dimensions by name, the order doesn't matter.\n",
"- an unordered list of *coordinates* or dimensions with coordinates with one item\n",
" per line. Each item has a name, one or more dimensions in parentheses, a dtype\n",
" and a preview of the values. Also, if it is a dimension coordinate, it will be\n",
" printed in **bold** font.\n",
"- an alphabetically sorted list of *dimensions without coordinates* (if there are any)\n",
"- an unordered list of *attributes*, or metadata"
"- **Dimensions**: summary of all *dimensions* of the `Dataset` `(lat: 25, time: 2920, lon: 53)`: this tells us that the first dimension is named `lat` and has a size of `25`, the second dimension is named `time` and has a size of `2920`, and the third dimension is named `lon` and has a size of `53`. Because we will access the dimensions by name, the order doesn't matter.\n",
"- **Coordinates**: an unordered list of *coordinates* or dimensions with coordinates with one item per line. Each item has a name, one or more dimensions in parentheses, a dtype and a preview of the values. Also, if it is a dimension coordinate, it will be printed in **bold** font. *dimensions without coordinates* appear in plain font (there are none in this example, but you might imagine a 'mask' coordinate that has a value assigned at every point).\n",
"- **Data variables**: names of each nD *measurement* in the dataset, followed by its dimensions `(time, lat, lon)`, dtype, and a preview of values.\n",
"- **Indexes**: Each dimension with coordinates is backed by an \"Index\". In this example, each dimension is backed by a `PandasIndex`\n",
"- **Attributes**: an unordered list of metadata (for example, a paragraph describing the dataset)"
]
},
{
Expand Down
Binary file added images/malaria_dataset.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 6 additions & 11 deletions workshops/scipy2024/index.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"\n",
"**Xarray**: *Friendly, Interactive, and Scalable Scientific Data Analysis*\n",
"\n",
"July 8, 13:30–17:30 (US/Pacific), Room 317\n",
"July 8, 13:30–17:30 (US/Pacific), Tacoma Convention Center Ballroom B/C\n",
"\n",
"This *4-hour* workshop will explore content from [the Xarray tutorial](https://tutorial.xarray.dev), which contains a comprehensive collection of hands-on tutorial Jupyter Notebooks. We will review a curated set of examples that will prepare you for increasingly complex real-world data analysis tasks!\n",
"\n",
Expand All @@ -33,13 +33,13 @@
"| Topic | Time | Notebook Links | \n",
"| :- | - | - | \n",
"| Introduction and Setup | 1:30 (10 min) | --- | \n",
"| The Xarray Data Model | 1:40 (40 min) | [Data structures](../../fundamentals/01_datastructures.ipynb) <br> [Basic Indexing](../../fundamentals/02.1_indexing_Basic.ipynb) | \n",
"| The Xarray Data Model | 1:40 (40 min) | [Data structures](../../fundamentals/01_data_structures.md) <br> [Basic Indexing](../../fundamentals/02.1_indexing_Basic.ipynb) | \n",
"| *10 minute Break* \n",
"| Indexing & Computational Patterns | 2:30 (50 min) | [Advanced Indexing](../../intermediate/indexing/indexing.md) <br> [Computational Patterns](../../intermediate/01-high-level-computation-patterns.ipynb) <br> | \n",
"| *10 minute Break* | \n",
"| Xarray Integrations and Extensions | 3:30 (50 min) | [The Xarray Ecosystem](../../intermediate/xarray_ecosystem.ipynb) | \n",
"| *10 minute Break* | \n",
"| Backends & Practice with your Data | 4:30 (50 min) | TODO: [Backends](../../advanced/backends/1.Backend_without_Lazy_Loading.ipynb) or Luis' remote data notebook |\n",
"| Backends & Remote data| 4:30 (50 min) | [Remote Data](../../intermediate/remote_data/remote-data.ipynb) |\n",
"| | End 5:30 | |\n",
"\n",
"\n",
Expand All @@ -66,6 +66,9 @@
"- Once you see a url to click within the terminal, simply `cmd + click` the given url.\n",
"- This will open up another tab in your browser, leading to a [Jupyter Lab](https://jupyterlab.readthedocs.io/en/latest/) Interface.\n",
"\n",
":::{warning}\n",
"Consider Codespaces as ephemeral environments. You may lose your connection and any edits you make.\n",
":::\n",
"\n",
"\n",
"## Thanks for attending!\n",
Expand All @@ -81,14 +84,6 @@
"- Max Jones (CarbonPlan)\n",
"- Wietze Suijker (Space Intelligence)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "1",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand Down

0 comments on commit b92ea70

Please sign in to comment.