|
10 | 10 | "\n", |
11 | 11 | ":::{admonition} Learning Goals\n", |
12 | 12 | "- Learn about xarray's internal and external backends\n", |
| 13 | + "- Learn how xarray selects backend engines\n", |
13 | 14 | "- Learn how to specify backend engines\n", |
14 | | - "- Learn how make your own custom backend\n", |
15 | 15 | ":::\n", |
16 | 16 | "\n", |
17 | 17 | "## What are Xarray Backends\n", |
|
24 | 24 | ":::{admonition} See also\n", |
25 | 25 | "You can learn more about xarray's [internal](https://tutorial.xarray.dev/advanced/backends/backends.html#links-to-internal-backends) and [external](https://tutorial.xarray.dev/advanced/backends/backends.html#links-to-external-backends-not-comprehensive) with our [guide](https://docs.xarray.dev/en/latest/user-guide/io.html) to backends.\n", |
26 | 26 | "\n", |
27 | | - ":::\n", |
28 | | - "\n", |
29 | | - "## Why should you create your own Xarray backend?\n", |
| 27 | + ":::" |
| 28 | + ] |
| 29 | + }, |
| 30 | + { |
| 31 | + "cell_type": "markdown", |
| 32 | + "id": "985ba2e6", |
| 33 | + "metadata": {}, |
| 34 | + "source": [ |
| 35 | + "## Reading a dataset with the netCDF4 engine\n", |
30 | 36 | "\n", |
31 | | - "- Allows you to use xarray's interface\n", |
32 | | - "- Easy integration with dask for lazy loading with Dask\n", |
33 | | - "- You don’t need to integrate any code in Xarray.\n" |
| 37 | + "We can read in a dataset by selecting the \"netcdf4\" engine" |
| 38 | + ] |
| 39 | + }, |
| 40 | + { |
| 41 | + "cell_type": "code", |
| 42 | + "execution_count": null, |
| 43 | + "id": "d25101fb", |
| 44 | + "metadata": {}, |
| 45 | + "outputs": [], |
| 46 | + "source": [ |
| 47 | + "import xarray as xr\n", |
| 48 | + "xr.tutorial.open_dataset('air_temperature', engine='netcdf4')" |
34 | 49 | ] |
35 | 50 | }, |
36 | 51 | { |
|
50 | 65 | "id": "8548e481", |
51 | 66 | "metadata": {}, |
52 | 67 | "source": [ |
53 | | - "### Check for available backends\n", |
| 68 | + "## Check for available backends\n", |
54 | 69 | "\n", |
55 | 70 | "We can get a list of our available engines with `list_engines`" |
56 | 71 | ] |
|
100 | 115 | "id": "992a1ed0", |
101 | 116 | "metadata": {}, |
102 | 117 | "source": [ |
103 | | - "### Reading without specifying engine\n", |
| 118 | + "## Reading without specifying engine\n", |
104 | 119 | "\n", |
105 | 120 | "When opening a file or URL without explicitly specifying the ``engine`` parameter,\n", |
106 | 121 | "xarray automatically selects an appropriate backend based on the file path or URL.\n", |
|
717 | 732 | "id": "c5e4f362", |
718 | 733 | "metadata": {}, |
719 | 734 | "source": [ |
720 | | - "### Setting engine order\n", |
| 735 | + "## Setting engine order\n", |
721 | 736 | "\n", |
722 | 737 | "You can customize the order in which netcdf4 backends are resolved using `xr.set_options(netcdf_engine_order=)`\n", |
723 | 738 | "\n", |
|
739 | 754 | "id": "ba077ebf", |
740 | 755 | "metadata": {}, |
741 | 756 | "source": [ |
742 | | - "### Specifying the wrong backend" |
| 757 | + "## Specifying the wrong backend" |
743 | 758 | ] |
744 | 759 | }, |
745 | 760 | { |
|
763 | 778 | "source": [ |
764 | 779 | "xr.tutorial.open_dataset('air_temperature', engine='pydap')" |
765 | 780 | ] |
766 | | - }, |
767 | | - { |
768 | | - "cell_type": "markdown", |
769 | | - "id": "1a798222", |
770 | | - "metadata": {}, |
771 | | - "source": [ |
772 | | - "## Creating your own Xarray Backend" |
773 | | - ] |
774 | 781 | } |
775 | 782 | ], |
776 | 783 | "metadata": { |
|
0 commit comments