'Evaluate a model at fixed positions, respecting the ``bounding_box``.
The key difference relative to evaluating the model directly is that
this method is limited to a bounding box if the `Model.bounding_box`
attribute is set.
Parameters
out : `numpy.ndarray`, optional
An array that the evaluated model will be added to.  If this is not
given (or given as ``None``), a new array will be created.
coords : array-like, optional
An array to be used to translate from the model\'s input coordinates
to the ``out`` array. It should have the property that
``self(coords)`` yields the same shape as ``out``.  If ``out`` is
not specified, ``coords`` will be used to determine the shape of the
returned array. If this is not provided (or None), the model will be
evaluated on a grid determined by `Model.bounding_box`.
Returns
out : `numpy.ndarray`
The model added to ``out`` if  ``out`` is not ``None``, or else a
new array from evaluating the model over ``coords``.
If ``out`` and ``coords`` are both `None`, the returned array is
limited to the `Model.bounding_box` limits. If
`Model.bounding_box` is `None`, ``arr`` or ``coords`` must be passed.
Raises
ValueError
If ``coords`` are not given and the the `Model.bounding_box` of this
model is not set.
Examples
:ref:`bounding-boxes`'

def render(self, out=None, coords=None):

    try:
        bbox = self.bounding_box
    except NotImplementedError:
        bbox = None
    ndim = self.n_inputs
    if ((coords is None) and (out is None) and (bbox is None)):
        raise ValueError(u'If    no    bounding_box    is    set,    coords    or    out    must    be    input.')
    if (ndim == 1):
        if (coords is not None):
            coords = [coords]
        if (bbox is not None):
            bbox = [bbox]
    if (coords is not None):
        coords = np.asanyarray(coords, dtype=float)
        assert (len(coords) == ndim)
        if (out is not None):
            if (coords[0].shape != out.shape):
                raise ValueError(u'inconsistent    shape    of    the    output.')
        else:
            out = np.zeros(coords[0].shape)
    if (out is not None):
        out = np.asanyarray(out, dtype=float)
        if (out.ndim != ndim):
            raise ValueError(u'the    array    and    model    must    have    the    same    number    of    dimensions.')
    if (bbox is not None):
        pd = np.array([(np.mean(bb), np.ceil(((bb[1] - bb[0]) / 2))) for bb in bbox]).astype(int).T
        (pos, delta) = pd
        if (coords is not None):
            sub_shape = tuple(((delta * 2) + 1))
            sub_coords = np.array([extract_array(c, sub_shape, pos) for c in coords])
        else:
            limits = [slice((p - d), ((p + d) + 1), 1) for (p, d) in pd.T]
            sub_coords = np.mgrid[limits]
        sub_coords = sub_coords[::(-1)]
        if (out is None):
            out = self(*sub_coords)
        else:
            try:
                out = add_array(out, self(*sub_coords), pos)
            except ValueError:
                raise ValueError(u'The    `bounding_box`    is    larger    than    the    input    out    in    one    or    more    dimensions.    Set    `model.bounding_box    =    None`.')
    else:
        if (coords is None):
            im_shape = out.shape
            limits = [slice(i) for i in im_shape]
            coords = np.mgrid[limits]
        coords = coords[::(-1)]
        out += self(*coords)
    return out
