Skip to content

Commit eef312a

Browse files
Add conda-forge badge, install note (#59)
* Add conda-forge badge, install note * Avoid making mypy unhappy
1 parent 8411437 commit eef312a

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ All regridding methods can operate lazily on [Dask arrays](https://docs.xarray.d
1515
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.
1616

1717
[![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)
1819
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.10203304.svg)](https://doi.org/10.5281/zenodo.10203304)
1920
[![Docs](https://readthedocs.org/projects/xarray-regrid/badge/?version=latest&style=flat)](https://xarray-regrid.readthedocs.org/)
2021

@@ -29,6 +30,8 @@ For a minimal install:
2930
pip install xarray-regrid
3031
```
3132

33+
*Note: xarray-regrid is also [available on conda-forge](https://anaconda.org/conda-forge/xarray-regrid).*
34+
3235
To improve performance in certain cases:
3336
```console
3437
pip install xarray-regrid[accel]
@@ -39,7 +42,7 @@ which includes optional extras such as:
3942
- `sparse`: for performing conservative regridding using sparse weight matrices
4043
- `opt-einsum`: optimized einsum routines used in conservative regridding
4144

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.
4346

4447
## Usage
4548
The xarray-regrid routines are accessed using the "regrid" accessor on an xarray Dataset:

src/xarray_regrid/utils.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ def format_lat(
311311
# TODO: with cos(90) = 0 weighting, these weights might be 0?
312312

313313
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()
315315

316316
# Only pad if global but don't have edge values directly at poles
317317
# NOTE: could use xr.pad here instead of xr.concat, but none of the
@@ -369,8 +369,8 @@ def format_lon(
369369
# Only pad if domain is global in lon
370370
source_lon = obj.coords[lon_coord]
371371
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()
374374
is_global_lon = source_lon.max().values - source_lon.min().values >= 360 - dx_s
375375

376376
if is_global_lon:

0 commit comments

Comments
 (0)