Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 321706a

Browse files
authored
Update Xarray in 45 min (#240)
* Update Xarray in 45 min * Fix errors * Small updates * Remove logo in most places
1 parent af3448e commit 321706a

16 files changed

+106
-81
lines changed

advanced/accessors/01_accessor_examples.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@
117117
"\n",
118118
"Perhaps you find yourself running similar code for multiple xarray objects or across related projects. By packing your code into an extension, it makes it easy to repeat the same operation while reducing the likelihood of [human introduced] errors.\n",
119119
"\n",
120-
"Here we wrap the reorganization of InSAR ice velocity data illustrated in [this tutorial](https://tutorial.xarray.dev/data_cleaning/ice_velocity.html?highlight=ice_velocity) into a custom Xarray extension that makes it easy to re-apply each time you begin working with a new InSAR velocity dataset. Please see the linked tutorial for details on the data, applications, and each step in this process."
120+
"Here we wrap the reorganization of InSAR ice velocity data illustrated in [this tutorial](https://tutorial.xarray.dev/intermediate/data_cleaning/05.3_ice_velocity.html) into a custom Xarray extension that makes it easy to re-apply each time you begin working with a new InSAR velocity dataset. Please see the linked tutorial for details on the data, applications, and each step in this process."
121121
]
122122
},
123123
{
@@ -425,5 +425,5 @@
425425
}
426426
},
427427
"nbformat": 4,
428-
"nbformat_minor": 2
428+
"nbformat_minor": 4
429429
}

advanced/map_blocks/simple_map_blocks.ipynb

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@
77
"tags": []
88
},
99
"source": [
10-
"<img src=\"https://docs.xarray.dev/en/stable/_static/dataset-diagram-logo.png\" align=\"right\" width=\"30%\">\n",
11-
"\n",
12-
"\n",
1310
"# A gentle introduction\n",
1411
"\n",
1512
"`map_blocks` is inspired by the `dask.array` function of the same name and lets\n",

fundamentals/01.1_creating_data_structures.ipynb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
"id": "0",
66
"metadata": {},
77
"source": [
8-
"<img src=\"https://docs.xarray.dev/en/stable/_static/dataset-diagram-logo.png\" align=\"right\" width=\"30%\">\n",
9-
"\n",
108
"# Creating Data Structures"
119
]
1210
},

fundamentals/01_datastructures.ipynb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
"cell_type": "markdown",
55
"metadata": {},
66
"source": [
7-
"<img src=\"https://docs.xarray.dev/en/stable/_static/dataset-diagram-logo.png\" align=\"right\" width=\"30%\">\n",
8-
"\n",
97
"# Xarray's Data structures\n",
108
"\n",
119
"In this lesson, we cover the basics of Xarray data structures. Our\n",

fundamentals/02.2_manipulating_dimensions.ipynb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
"cell_type": "markdown",
55
"metadata": {},
66
"source": [
7-
"<img src=\"https://docs.xarray.dev/en/stable/_static/dataset-diagram-logo.png\" align=\"right\" width=\"30%\">\n",
8-
"\n",
97
"# Manipulating Dimensions (Data Resolution)\n",
108
"\n",
119
"Sometimes we need to change the resolution of our data. We might need to look at inferred values between dimension (grid) spaces\n",

fundamentals/02.3_aligning_data_objects.ipynb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
"cell_type": "markdown",
55
"metadata": {},
66
"source": [
7-
"<img src=\"https://docs.xarray.dev/en/stable/_static/dataset-diagram-logo.png\" align=\"right\" width=\"30%\">\n",
8-
"\n",
97
"# Computing with Multiple Objects\n",
108
"\n",
119
"Learning goals:\n",

fundamentals/03.4_weighted.ipynb

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@
77
"tags": []
88
},
99
"source": [
10-
"<img src=\"https://docs.xarray.dev/en/stable/_static/dataset-diagram-logo.png\" align=\"right\" width=\"30%\">\n",
11-
"\n",
12-
"\n",
1310
"# Weighted Reductions\n",
1411
"\n",
1512
"Xarray supports [weighted reductions](https://docs.xarray.dev/en/stable/user-guide/computation.html#weighted-array-reductions).\n",

fundamentals/04.1_basic_plotting.ipynb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
"toc": true
77
},
88
"source": [
9-
"<img src=\"https://docs.xarray.dev/en/stable/_static/dataset-diagram-logo.png\" align=\"right\" width=\"30%\">\n",
10-
"\n",
119
"# Basic Visualization\n",
1210
"\n",
1311
"At the end of this lesson you will learn:\n",

fundamentals/04.2_faceting.ipynb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
"id": "0",
66
"metadata": {},
77
"source": [
8-
"<img src=\"https://docs.xarray.dev/en/stable/_static/dataset-diagram-logo.png\" align=\"right\" width=\"30%\">\n",
9-
"\n",
108
"# Faceting\n",
119
"\n",
1210
"Faceting is the art of presenting \"small multiples\" of the data. It is an\n",

fundamentals/04.3_geographic_plotting.ipynb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
"id": "0",
66
"metadata": {},
77
"source": [
8-
"<img src=\"https://docs.xarray.dev/en/stable/_static/dataset-diagram-logo.png\" align=\"right\" width=\"30%\">\n",
9-
"\n",
108
"# Geography with Cartopy\n",
119
"\n",
1210
"Since xarray's default plotting functionality builds on matplotlib, we can\n",

fundamentals/05_intro_to_dask.ipynb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
"cell_type": "markdown",
55
"metadata": {},
66
"source": [
7-
"<img src=\"https://docs.xarray.dev/en/stable/_static/dataset-diagram-logo.png\" align=\"right\" width=\"30%\">\n",
8-
"\n",
97
"# Introduction to Dask\n",
108
"\n",
119
"In this lesson, we discuss cover the basics of Dask. Our learning goals are as\n",

intermediate/hvplot.ipynb

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@
55
"id": "0",
66
"metadata": {},
77
"source": [
8-
"<img src=\"https://docs.xarray.dev/en/stable/_static/dataset-diagram-logo.png\" align=\"right\" width=\"30%\">\n",
9-
"\n",
10-
"\n",
118
"# Interactive plots using hvplot\n",
129
"\n",
1310
"Xarray's builtin plotting functionality wraps matplotlib.\n",

intermediate/xarray_and_dask.ipynb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
"cell_type": "markdown",
55
"metadata": {},
66
"source": [
7-
"<img src=\"https://docs.xarray.dev/en/stable/_static/dataset-diagram-logo.png\" align=\"right\" width=\"30%\">\n",
8-
"\n",
97
"# Parallel computing with Dask\n",
108
"\n",
119
"This notebook demonstrates one of Xarray's most powerful features: the ability\n",

intermediate/xarray_ecosystem.ipynb

Lines changed: 20 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
"cell_type": "markdown",
66
"metadata": {},
77
"source": [
8-
"<img src=\"https://docs.xarray.dev/en/stable/_static/dataset-diagram-logo.png\" align=\"right\" width=\"30%\">\n",
9-
"\n",
108
"# A Tour of Xarray Customizations\n",
119
"\n",
1210
"Xarray is easily extensible.\n",
@@ -510,7 +508,9 @@
510508
"cell_type": "markdown",
511509
"metadata": {},
512510
"source": [
513-
"Note: It is preferred to use `.pint.quantify()` to convert xarray data to use pint rather than explicitly creating a `pint.Quantity` array and placing it inside the xarray object, because pint-xarray will handle various subtleties involving dask etc."
511+
"```{note}\n",
512+
"It is preferred to use `.pint.quantify()` to convert xarray data to use pint rather than explicitly creating a `pint.Quantity` array and placing it inside the xarray object, because pint-xarray will handle various subtleties involving dask etc.\n",
513+
"```"
514514
]
515515
},
516516
{
@@ -609,34 +609,39 @@
609609
"cell_type": "markdown",
610610
"metadata": {},
611611
"source": [
612-
"**Exercise:** Write a function which will raise an error if supplied with data in the wrong units."
613-
]
614-
},
615-
{
616-
"cell_type": "code",
617-
"execution_count": null,
618-
"metadata": {},
619-
"outputs": [],
620-
"source": [
612+
"```{exercise}\n",
613+
":label: wrong-unit\n",
614+
"Write a function which will raise a `pint.DimensionalityError` if supplied with Xarray DataArray with the wrong units.\n",
615+
"```\n",
616+
"\n",
617+
"````{solution} wrong-unit\n",
618+
":class: dropdown\n",
619+
"\n",
620+
"```python\n",
621621
"from pint import DimensionalityError\n",
622622
"\n",
623623
"\n",
624624
"def special_science_function(distance):\n",
625625
" if distance.pint.units != \"miles\":\n",
626626
" raise DimensionalityError(\n",
627627
" \"this function will only give the correct answer if the input is in units of miles\"\n",
628-
" )"
628+
" )\n",
629+
"```\n",
630+
"\n",
631+
"````"
629632
]
630633
},
631634
{
632635
"cell_type": "markdown",
633636
"metadata": {},
634637
"source": [
635-
"**Exercise:** Try this on some of your data!\n",
638+
"```{exercise}\n",
639+
"Try this on some of your data!\n",
636640
"\n",
637641
"After you have imported pint-xarray (and maybe cf-xarray) as above, start with something like\n",
638642
"\n",
639-
"`ds = xr.open_dataset(my_data).pint.quantify()`"
643+
"`ds = xr.open_dataset(my_data).pint.quantify()`\n",
644+
"```"
640645
]
641646
},
642647
{
@@ -659,13 +664,6 @@
659664
"source": [
660665
"There are many other libraries in the wider xarray ecosystem. For a list of a few packages we particularly like for geoscience work [see here](https://tutorial.xarray.dev/overview/xarray-in-45-min.html#other-cool-packages), and for a [more exhaustive list see here](https://docs.xarray.dev/en/stable/ecosystem.html)."
661666
]
662-
},
663-
{
664-
"cell_type": "code",
665-
"execution_count": null,
666-
"metadata": {},
667-
"outputs": [],
668-
"source": []
669667
}
670668
],
671669
"metadata": {

overview/get-started.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<img src="https://docs.xarray.dev/en/stable/_static/dataset-diagram-logo.png" align="right" width="30%">
1+
<img src="https://docs.xarray.dev/en/stable/_static/Xarray_Logo_RGB_Final.svg" align="right" width="30%">
22

33
(get-started)=
44

0 commit comments

Comments
 (0)