import warnings


def _deprecate_pims(call):
    """Wrap a pims callable with a warning that it is deprecated."""
    def deprecated_pims_import(*args, **kw):
        """Class imported from pims package. Its presence in trackpy is deprecated."""
        warnings.warn(('trackpy.{0} is being called, but "{0}" is really part of the '
                      'pims package. It will not be in future versions of trackpy. '
                      'Consider importing pims and calling pims.{0} instead.'
                      ).format(call.__name__), UserWarning)
        return call(*args, **kw)
    return deprecated_pims_import