# Path: rbf/utils.py
# def assert_shape(arr, shape, label='array'):
#     '''
#     Raises a ValueError if `arr` does not have the specified shape
# 
#     Parameters
#     ----------
#     arr : array-like
# 
#     shape : tuple
#         The shape requirement for `arr`. This can have `None` to indicate that
#         an axis can have any length. This can also have an Ellipsis to only
#         enforce the shape for the first and/or last dimensions of `arr`
# 
#     label : str
#         What to call `arr` in the error
# 
#     '''
#     if not _SHAPE_ASSERTIONS:
#         return
# 
#     if hasattr(arr, 'shape'):
#         # if `arr` has a shape attribute then use it rather than finding the
#         # shape with np.shape, which converts `arr` to a numpy array
#         arr_shape = arr.shape
#     else:
#         arr_shape = np.shape(arr)
# 
#     arr_ndim = len(arr_shape)
#     if Ellipsis in shape:
#         # If `shape` has an ellipsis then only the first and/or last dimensions
#         # will be checked
#         start_shape = shape[:shape.index(Ellipsis)]
#         end_shape = shape[shape.index(Ellipsis) + 1:]
#         start_ndim = len(start_shape)
#         end_ndim = len(end_shape)
#         if arr_ndim < (start_ndim + end_ndim):
#             raise ValueError(
#                 '%s is %d dimensional but it should have at least %d '
#                 'dimensions' % (label, arr_ndim, start_ndim + end_ndim))
# 
#         arr_start_shape = arr_shape[:start_ndim]
#         arr_end_shape = arr_shape[arr_ndim - end_ndim:]
#         for axis, (i, j) in enumerate(zip(arr_start_shape, start_shape)):
#             if j is None:
#                 continue
# 
#             if i != j:
#                 raise ValueError(
#                     'axis %d of %s has length %d but it should have length %d'
#                     % (axis, label, i, j))
# 
#         for axis, (i, j) in enumerate(zip(arr_end_shape, end_shape)):
#             if j is None:
#                 continue
# 
#             if i != j:
#                 raise ValueError(
#                     'axis %d of %s has length %d but it should have length %d'
#                     % (arr_ndim - end_ndim + axis, label, i, j))
# 
#     else:
#         ndim = len(shape)
#         if arr_ndim != ndim:
#             raise ValueError(
#                 '%s is %d dimensional but it should have %d dimensions'
#                 % (label, arr_ndim, ndim))
# 
#         for axis, (i, j) in enumerate(zip(arr_shape, shape)):
#             if j is None:
#                 continue
# 
#             if i != j:
#                 raise ValueError(
#                     'axis %d of %s has length %d but it should have length %d'
#                     % (axis, label, i, j))
# 
#     return


import logging
import weakref
import sympy
import numpy as np
from scipy.sparse import csc_matrix
from scipy.spatial import cKDTree
from sympy.utilities.autowrap import ufuncify
from sympy import lambdify
from rbf.poly import monomial_powers
from rbf.utils import assert_shape

        diff : (D,) int array, optional
            Specifies the derivative order for each Cartesian direction. For
            example, if there are three spatial dimensions then providing
            (2, 0, 1) would cause this function to return the RBF after
            differentiating it twice along the first axis and once along the
            third axis.

        Returns
        -------
        out : (N, M) csc sparse matrix
            The RBFs with centers `c` evaluated at `x`

        '''
        x = np.asarray(x, dtype=float)
        assert_shape(x, (None, None), 'x')
        ndim = x.shape[1]

        c = np.asarray(c, dtype=float)
        assert_shape(c, (None, ndim), 'c')

        if not np.isscalar(eps):
            raise NotImplementedError('`eps` must be a scalar')

        if diff is None:
            diff = (0,)*ndim

        else:
            # make sure diff is immutable
            diff = tuple(diff)

# Path: rbf/utils.py
# def assert_shape(arr, shape, label='array'):
#     '''
#     Raises a ValueError if `arr` does not have the specified shape
# 
#     Parameters
#     ----------
#     arr : array-like
# 
#     shape : tuple
#         The shape requirement for `arr`. This can have `None` to indicate that
#         an axis can have any length. This can also have an Ellipsis to only
#         enforce the shape for the first and/or last dimensions of `arr`
# 
#     label : str
#         What to call `arr` in the error
# 
#     '''
#     if not _SHAPE_ASSERTIONS:
#         return
# 
#     if hasattr(arr, 'shape'):
#         # if `arr` has a shape attribute then use it rather than finding the
#         # shape with np.shape, which converts `arr` to a numpy array
#         arr_shape = arr.shape
#     else:
#         arr_shape = np.shape(arr)
# 
#     arr_ndim = len(arr_shape)
#     if Ellipsis in shape:
#         # If `shape` has an ellipsis then only the first and/or last dimensions
#         # will be checked
#         start_shape = shape[:shape.index(Ellipsis)]
#         end_shape = shape[shape.index(Ellipsis) + 1:]
#         start_ndim = len(start_shape)
#         end_ndim = len(end_shape)
#         if arr_ndim < (start_ndim + end_ndim):
#             raise ValueError(
#                 '%s is %d dimensional but it should have at least %d '
#                 'dimensions' % (label, arr_ndim, start_ndim + end_ndim))
# 
#         arr_start_shape = arr_shape[:start_ndim]
#         arr_end_shape = arr_shape[arr_ndim - end_ndim:]
#         for axis, (i, j) in enumerate(zip(arr_start_shape, start_shape)):
#             if j is None:
#                 continue
# 
#             if i != j:
#                 raise ValueError(
#                     'axis %d of %s has length %d but it should have length %d'
#                     % (axis, label, i, j))
# 
#         for axis, (i, j) in enumerate(zip(arr_end_shape, end_shape)):
#             if j is None:
#                 continue
# 
#             if i != j:
#                 raise ValueError(
#                     'axis %d of %s has length %d but it should have length %d'
#                     % (arr_ndim - end_ndim + axis, label, i, j))
# 
#     else:
#         ndim = len(shape)
#         if arr_ndim != ndim:
#             raise ValueError(
#                 '%s is %d dimensional but it should have %d dimensions'
#                 % (label, arr_ndim, ndim))
# 
#         for axis, (i, j) in enumerate(zip(arr_shape, shape)):
#             if j is None:
#                 continue
# 
#             if i != j:
#                 raise ValueError(
#                     'axis %d of %s has length %d but it should have length %d'
#                     % (axis, label, i, j))
# 
#     return


# Path: rbf/basis.py
import logging
import weakref
import sympy
import numpy as np
from scipy.sparse import csc_matrix
from scipy.spatial import cKDTree
from sympy.utilities.autowrap import ufuncify
from sympy import lambdify
from rbf.poly import monomial_powers
from rbf.utils import assert_shape


        diff : (D,) int array, optional
            Specifies the derivative order for each Cartesian direction. For
            example, if there are three spatial dimensions then providing
            (2, 0, 1) would cause this function to return the RBF after
            differentiating it twice along the first axis and once along the
            third axis.

        Returns
        -------
        out : (N, M) csc sparse matrix
            The RBFs with centers `c` evaluated at `x`

        '''
        x = np.asarray(x, dtype=float)
        assert_shape(x, (None, None), 'x')
        ndim = x.shape[1]

        c = np.asarray(c, dtype=float)
        assert_shape(c, (None, ndim), 'c')

        if not np.isscalar(eps):
            raise NotImplementedError('`eps` must be a scalar')

        if diff is None:
            diff = (0,)*ndim

        else:
            # make sure diff is immutable
            diff = tuple(diff)

            assert_shape(diff, (ndim,), 'diff')