Skip to content

Commit 528a8c4

Browse files
committed
use python code cells
1 parent 7ddb555 commit 528a8c4

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

docs/agnostic/pint.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Learn more at the [pint-xarray](https://pint-xarray.readthedocs.io/en/latest/) d
3434

3535
First we open the dataset and perform some preprocessing:
3636

37-
```{python}
37+
```{code-cell} python
3838
import numpy as np
3939
import xarray as xr
4040
@@ -69,7 +69,7 @@ Note how all variables are associated with a {py:class}`pint.Quantity` array, an
6969

7070
With the `PintIndex`, selecting with quantities will convert the indexers to the index' units:
7171

72-
```{python}
72+
```{code-cell} python
7373
quantified.sel(
7474
latitude=slice(ureg.Quantity(4800, "arcmin"), ureg.Quantity(600, "arcmin")),
7575
longitude=slice(ureg.Quantity(-10, "degree"), ureg.Quantity(np.pi, "radians")),
@@ -78,7 +78,7 @@ quantified.sel(
7878

7979
or raise on incompatible units:
8080

81-
```{python}
81+
```{code-cell} python
8282
quantified.sel(
8383
months=ureg.Quantity(10, "m"),
8484
level=200,
@@ -91,7 +91,7 @@ quantified.sel(
9191

9292
We can also perform numerical operations, like integration:
9393

94-
```{python}
94+
```{code-cell} python
9595
quantified["windspeed"].integrate("months")
9696
```
9797

0 commit comments

Comments
 (0)