Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
* deprecated the module :mod:`iris.analysis.interpolate`.
This contains the following public items, all of which are now deprecated and
will be removed in a future release:
* :func:`~iris.analysis.interpolate.linear`
* :func:`~iris.analysis.interpolate.regrid`
* :func:`~iris.analysis.interpolate.regrid_to_max_resolution`
* :func:`~iris.analysis.interpolate.nearest_neighbour_indices`
* :func:`~iris.analysis.interpolate.nearest_neighbour_data_value`
* :func:`~iris.analysis.interpolate.extract_nearest_neighbour`
* class :class:`~iris.analysis.interpolate.Linear1dExtrapolator`.
Please use the replacement facilities individually noted in the module
documentation for :mod:`iris.analysis.interpolate`
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
* the method :meth:`iris.cube.Cube.regridded` has been deprecated.
Please use :meth:`iris.cube.Cube.regrid` instead (see
:meth:`~iris.cube.Cube.regridded` for details).
44 changes: 44 additions & 0 deletions lib/iris/_deprecation_helpers.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# (C) British Crown Copyright 2010 - 2016, Met Office
#
# This file is part of Iris.
#
# Iris is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by the
# Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Iris is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with Iris. If not, see <http://www.gnu.org/licenses/>.
"""
Utilities for producing runtime deprecation messages.

"""
from __future__ import (absolute_import, division, print_function)
from six.moves import (filter, input, map, range, zip) # noqa
import six

import warnings


# A Mixin for a wrapper class that copies the docstring of the wrapped class
# into the wrapper.
# This is useful in producing wrapper classes that nede to mimic the original
# but emit deprecation warnings when used.
class ClassWrapperSameDocstring(type):
def __new__(metacls, classname, bases, class_dict):
# Patch the subclass to duplicate the class docstring from the wrapped
# class, and give it a special '__new__' that issues a deprecation
# warning when creating an instance.
parent_class = bases[0]

# Copy the original class docstring.
class_dict['__doc__'] = parent_class.__doc__

# Return the result.
return super(ClassWrapperSameDocstring, metacls).__new__(
metacls, classname, bases, class_dict)
Loading