You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+20-11Lines changed: 20 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,31 +4,37 @@ Subset Xarray datasets in space while retaining the original grid for complex gr
4
4
5
5
## Installation
6
6
7
-
### `pip compatible`
7
+
### `pip`
8
8
9
9
This package is available on pypi:
10
10
11
11
```
12
12
python -m pip install xarray-subset-grid
13
13
```
14
14
15
-
And also on conda-forge:
15
+
### conda / pixi
16
+
17
+
This package is available on conda-forge:
16
18
17
19
```
18
20
conda install -c conda-forge xarray-subset-grid
19
21
```
20
22
21
23
## Usage
22
24
23
-
This package is designed to be used in conjunction with [`xarray`](https://xarray.dev/). Given a [CF Compliant](https://cfconventions.org/)`xarray` dataset named `ds`, this package can be accessed using the `xsg` accessor:
25
+
This package is designed to be used in conjunction with [`xarray`](https://xarray.dev/).
26
+
Given a [CF Compliant](https://cfconventions.org/)`xarray` dataset named `ds`, this package can be accessed using the `xsg` accessor:
24
27
25
28
```python
29
+
26
30
import numpy as np
27
31
28
-
# Get the interpreted grid class
32
+
# xarray_subset_gris should detect the grid type.
33
+
# To check what it found:
29
34
grid = ds.xsg
30
35
31
-
# subset to only include temperature
36
+
# subsetting to include only certain variables:
37
+
# Only temperature
32
38
ds_temp = ds.xsg.subset_vars(["temp"])
33
39
34
40
# subset by bounding box
@@ -47,11 +53,12 @@ poly = np.array(
47
53
ds_subset_poly = ds.xsg.subset_polygon(poly)
48
54
```
49
55
50
-
For full usage, see the [example notebooks](https://github.com/ioos/xarray-subset-grid/tree/main/docs/examples) and the [Sphinx documentation on Read the Docs](https://xarray-subset-grid.readthedocs.io/).
56
+
For full usage, see the [example notebooks](https://github.com/ioos/xarray-subset-grid/tree/main/docs/examples)
57
+
and the [Sphinx documentation on Read the Docs](https://xarray-subset-grid.readthedocs.io/).
51
58
52
59
## Development
53
60
54
-
### `pip compatible`
61
+
### `pip`
55
62
56
63
First, create a new `virtualenv` and activate it:
57
64
@@ -109,13 +116,14 @@ pixi run -e test312 test
109
116
Options are: `test310``test311``test312``test313`
110
117
111
118
112
-
To run a shell to do dev work:
119
+
To run a shell to do development work:
113
120
114
121
```bash
115
122
pixi shell -e dev
116
123
```
117
124
118
-
To run a shell in which you can run the examples (notebooks and al that):
125
+
To run a shell in which you can run the examples
126
+
(notebooks and all that):
119
127
120
128
```bash
121
129
pixi shell -e examples
@@ -127,10 +135,11 @@ To run a shell with everything (dev and example deps:
127
135
pixi shell -e all
128
136
```
129
137
130
-
Finally, to when the `pyproject.toml` is updated, be sure to update the `pixi` lockfile:
0 commit comments