Skip to content

Commit fc2b6e7

Browse files
committed
section about netcdf4 backends
1 parent 0bda90a commit fc2b6e7

1 file changed

Lines changed: 26 additions & 19 deletions

File tree

advanced/backends/intro-backends.ipynb

Lines changed: 26 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
"\n",
1111
":::{admonition} Learning Goals\n",
1212
"- Learn about xarray's internal and external backends\n",
13+
"- Learn how xarray selects backend engines\n",
1314
"- Learn how to specify backend engines\n",
14-
"- Learn how make your own custom backend\n",
1515
":::\n",
1616
"\n",
1717
"## What are Xarray Backends\n",
@@ -24,13 +24,28 @@
2424
":::{admonition} See also\n",
2525
"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",
2626
"\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",
3036
"\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')"
3449
]
3550
},
3651
{
@@ -50,7 +65,7 @@
5065
"id": "8548e481",
5166
"metadata": {},
5267
"source": [
53-
"### Check for available backends\n",
68+
"## Check for available backends\n",
5469
"\n",
5570
"We can get a list of our available engines with `list_engines`"
5671
]
@@ -100,7 +115,7 @@
100115
"id": "992a1ed0",
101116
"metadata": {},
102117
"source": [
103-
"### Reading without specifying engine\n",
118+
"## Reading without specifying engine\n",
104119
"\n",
105120
"When opening a file or URL without explicitly specifying the ``engine`` parameter,\n",
106121
"xarray automatically selects an appropriate backend based on the file path or URL.\n",
@@ -717,7 +732,7 @@
717732
"id": "c5e4f362",
718733
"metadata": {},
719734
"source": [
720-
"### Setting engine order\n",
735+
"## Setting engine order\n",
721736
"\n",
722737
"You can customize the order in which netcdf4 backends are resolved using `xr.set_options(netcdf_engine_order=)`\n",
723738
"\n",
@@ -739,7 +754,7 @@
739754
"id": "ba077ebf",
740755
"metadata": {},
741756
"source": [
742-
"### Specifying the wrong backend"
757+
"## Specifying the wrong backend"
743758
]
744759
},
745760
{
@@ -763,14 +778,6 @@
763778
"source": [
764779
"xr.tutorial.open_dataset('air_temperature', engine='pydap')"
765780
]
766-
},
767-
{
768-
"cell_type": "markdown",
769-
"id": "1a798222",
770-
"metadata": {},
771-
"source": [
772-
"## Creating your own Xarray Backend"
773-
]
774781
}
775782
],
776783
"metadata": {

0 commit comments

Comments
 (0)