Skip to content

Commit 2fa7c59

Browse files
authored
Deprecate regrids (#4548)
* Deprecations. * Correct and clarify dosctrings for PointInCell. * Remove reference from UnstructuredNearest to ProjectedUnstructuredNearest. * Added whatsnew content. * Tiny fix to deprecation docs. * Fixes to whatsnew text. * Move still-used code from experimental.regrid to analysis._area_weighted. * Fix minor test problem. * No iris.cube import in iris.analysis._area_weighted, to avoid circular import.
1 parent 25d3b35 commit 2fa7c59

File tree

5 files changed

+1148
-1027
lines changed

5 files changed

+1148
-1027
lines changed

docs/src/whatsnew/latest.rst

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,12 @@ This document explains the changes made to Iris for this release
234234
#. `@pp-mo`_ deprecated :mod:`iris.experimental.regrid_conservative`. This is
235235
now replaced by `iris-emsf-regrid`_. (:pull:`4551`)
236236

237+
#. `@pp-mo`_ deprecated everything in :mod:`iris.experimental.regrid`.
238+
Most features have a preferred exact alternative, as suggested, *except*
239+
:class:`iris.experimental.regrid.ProjectedUnstructuredLinear` : that has no
240+
identical equivalent, but :class:`iris.analysis.UnstructuredNearest` is
241+
suggested as being quite close (though possibly slower). (:pull:`4548`)
242+
237243

238244
🔗 Dependencies
239245
===============
@@ -289,6 +295,15 @@ This document explains the changes made to Iris for this release
289295
contributing to the docs <contributing.documentation_easy>` to the docs.
290296
(:pull:`4461`)
291297

298+
#. `@pp-mo`_ improved and corrected docstrings of
299+
:class:`iris.analysis.PointInCell`, making it clear what is the actual
300+
calculation performed. (:pull:`4548`)
301+
302+
#. `@pp-mo`_ removed reference in docstring of
303+
:class:`iris.analysis.UnstructuredNearest` to the obsolete (deprecated)
304+
:class:`iris.experimental.regrid.ProjectedUnstructuredNearest`.
305+
(:pull:`4548`)
306+
292307

293308
💼 Internal
294309
===========

lib/iris/analysis/__init__.py

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2691,14 +2691,6 @@ class UnstructuredNearest:
26912691
.. Note::
26922692
Currently only supports regridding, not interpolation.
26932693
2694-
.. Note::
2695-
This scheme performs essentially the same job as
2696-
:class:`iris.experimental.regrid.ProjectedUnstructuredNearest`.
2697-
That scheme is faster, but only works well on data in a limited
2698-
region of the globe, covered by a specified projection.
2699-
This approach is more rigorously correct and can be applied to global
2700-
datasets.
2701-
27022694
"""
27032695

27042696
# Note: the argument requirements are simply those of the underlying
@@ -2769,6 +2761,9 @@ class PointInCell:
27692761
This class describes the point-in-cell regridding scheme for use
27702762
typically with :meth:`iris.cube.Cube.regrid()`.
27712763
2764+
Each result datapoint is an average over all source points that fall inside
2765+
that (bounded) target cell.
2766+
27722767
The PointInCell regridder can regrid data from a source grid of any
27732768
dimensionality and in any coordinate system.
27742769
The location of each source point is specified by X and Y coordinates
@@ -2786,8 +2781,12 @@ class PointInCell:
27862781

27872782
def __init__(self, weights=None):
27882783
"""
2789-
Point-in-cell regridding scheme suitable for regridding over one
2790-
or more orthogonal coordinates.
2784+
Point-in-cell regridding scheme suitable for regridding from a source
2785+
cube with X and Y coordinates all on the same dimensions, to a target
2786+
cube with bounded X and Y coordinates on separate X and Y dimensions.
2787+
2788+
Each result datapoint is an average over all source points that fall
2789+
inside that (bounded) target cell.
27912790
27922791
Optional Args:
27932792

0 commit comments

Comments
 (0)