File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ All regridding methods can operate lazily on [Dask arrays](https://docs.xarray.d
15
15
Note that "Most common value" is designed to regrid categorical data to a coarse resolution. For regridding categorical data to a finer resolution, please use "nearest-neighbor" regridder.
16
16
17
17
[ ![ PyPI] ( https://img.shields.io/pypi/v/xarray-regrid.svg?style=flat )] ( https://pypi.python.org/pypi/xarray-regrid/ )
18
+ [ ![ conda-forge] ( https://anaconda.org/conda-forge/xarray-regrid/badges/version.svg )] ( https://anaconda.org/conda-forge/xarray-regrid )
18
19
[ ![ DOI] ( https://zenodo.org/badge/DOI/10.5281/zenodo.10203304.svg )] ( https://doi.org/10.5281/zenodo.10203304 )
19
20
[ ![ Docs] ( https://readthedocs.org/projects/xarray-regrid/badge/?version=latest&style=flat )] ( https://xarray-regrid.readthedocs.org/ )
20
21
@@ -29,6 +30,8 @@ For a minimal install:
29
30
pip install xarray-regrid
30
31
```
31
32
33
+ * Note: xarray-regrid is also [ available on conda-forge] ( https://anaconda.org/conda-forge/xarray-regrid ) .*
34
+
32
35
To improve performance in certain cases:
33
36
``` console
34
37
pip install xarray-regrid[accel]
@@ -39,7 +42,7 @@ which includes optional extras such as:
39
42
- ` sparse ` : for performing conservative regridding using sparse weight matrices
40
43
- ` opt-einsum ` : optimized einsum routines used in conservative regridding
41
44
42
- Benchmarking varies across different hardware specifications, but the inclusion of these extras can often provide significant speedups.
45
+ Benchmarking varies across different hardware specifications, but the inclusion of these extras can often provide significant speedups.
43
46
44
47
## Usage
45
48
The xarray-regrid routines are accessed using the "regrid" accessor on an xarray Dataset:
Original file line number Diff line number Diff line change @@ -311,7 +311,7 @@ def format_lat(
311
311
# TODO: with cos(90) = 0 weighting, these weights might be 0?
312
312
313
313
polar_lat = 90
314
- dy = obj .coords [lat_coord ].diff (lat_coord ).max ().values .item ()
314
+ dy : Any = obj .coords [lat_coord ].diff (lat_coord ).max ().values .item ()
315
315
316
316
# Only pad if global but don't have edge values directly at poles
317
317
# NOTE: could use xr.pad here instead of xr.concat, but none of the
@@ -369,8 +369,8 @@ def format_lon(
369
369
# Only pad if domain is global in lon
370
370
source_lon = obj .coords [lon_coord ]
371
371
target_lon = target .coords [lon_coord ]
372
- dx_s = source_lon .diff (lon_coord ).max ().values .item ()
373
- dx_t = target_lon .diff (lon_coord ).max ().values .item ()
372
+ dx_s : Any = source_lon .diff (lon_coord ).max ().values .item ()
373
+ dx_t : Any = target_lon .diff (lon_coord ).max ().values .item ()
374
374
is_global_lon = source_lon .max ().values - source_lon .min ().values >= 360 - dx_s
375
375
376
376
if is_global_lon :
You can’t perform that action at this time.
0 commit comments