def __init__(self, fspace, tspace, sampling=None, interpol=None):
        """Abstract initialization method.

        Intended to be called by subclasses for proper type checking
        and setting of attributes.

        Parameters
        ----------
        fspace : `Set`
            The non-discretized (abstract) set to be discretized.
        tspace : `TensorSpace`
            Space providing containers for the values/coefficients of a
            discretized object.
        sampling : `Operator`, optional
            Operator mapping an `fspace` element to a `tspace` element.
            Must satisfy ``sampling.domain == fspace``,
            ``sampling.range == tspace``.
        interpol : `Operator`, optional
            Operator mapping a `tspace` element to an `fspace` element.
            Must satisfy ``interpol.domain == tspace``,
            ``interpol.range == fspace``.
            """
        if not isinstance(fspace, Set):
            raise TypeError('`fspace` must be a `Set` instance, '
                            'got {!r}'.format(fspace))
        if not isinstance(tspace, TensorSpace):
            raise TypeError('`tspace` {!r} not a `TensorSpace` instance'
                            ''.format(tspace))

        if sampling is not None:
            if not isinstance(sampling, Operator):
                raise TypeError('`sampling` {!r} not an `Operator` '
                                'instance'.format(sampling))
            if sampling.domain != fspace:
                raise ValueError('`sampling.domain` {!r} not equal to '
                                 '`fspace` {!r}'
                                 ''.format(sampling.domain, tspace))
            if sampling.range != tspace:
                raise ValueError('`sampling.range` {!r} not equal to'
                                 '`tspace` {!r}'
                                 ''.format(sampling.range, tspace))

        if interpol is not None:
            if not isinstance(interpol, Operator):
                raise TypeError('`interpol` {!r} not an Operator '
                                'instance'.format(interpol))
            if interpol.domain != tspace:
                raise ValueError('`interpol.domain` {} not equal to '
                                 '`tspace` {!r}'
                                 ''.format(interpol.domain, tspace))
            if interpol.range != fspace:
                raise ValueError('`interpol.range` {!r} not equal to '
                                 '`fspace` {!r}'
                                 ''.format(interpol.range, fspace))

        super(DiscretizedSpace, self).__init__(tspace.shape, tspace.dtype)
        self.__fspace = fspace
        self.__tspace = tspace
        self.__sampling = sampling
        self.__interpolation = interpol
def __init__ ( self , fspace , tspace , sampling = None , interpol = None ) : if not isinstance ( fspace , Set ) : raise TypeError ( '`fspace` must be a `Set` instance, ' 'got {!r}' . format ( fspace ) ) if not isinstance ( tspace , TensorSpace ) : raise TypeError ( '`tspace` {!r} not a `TensorSpace` instance' '' . format ( tspace ) ) if sampling is not None : if not isinstance ( sampling , Operator ) : raise TypeError ( '`sampling` {!r} not an `Operator` ' 'instance' . format ( sampling ) ) if sampling . domain != fspace : raise ValueError ( '`sampling.domain` {!r} not equal to ' '`fspace` {!r}' '' . format ( sampling . domain , tspace ) ) if sampling . range != tspace : raise ValueError ( '`sampling.range` {!r} not equal to' '`tspace` {!r}' '' . format ( sampling . range , tspace ) ) if interpol is not None : if not isinstance ( interpol , Operator ) : raise TypeError ( '`interpol` {!r} not an Operator ' 'instance' . format ( interpol ) ) if interpol . domain != tspace : raise ValueError ( '`interpol.domain` {} not equal to ' '`tspace` {!r}' '' . format ( interpol . domain , tspace ) ) if interpol . range != fspace : raise ValueError ( '`interpol.range` {!r} not equal to ' '`fspace` {!r}' '' . format ( interpol . range , fspace ) ) super ( DiscretizedSpace , self ) . __init__ ( tspace . shape , tspace . dtype ) self . __fspace = fspace self . __tspace = tspace self . __sampling = sampling self . __interpolation = interpol
Abstract initialization method.

        Intended to be called by subclasses for proper type checking
        and setting of attributes.

        Parameters
        ----------
        fspace : `Set`
            The non-discretized (abstract) set to be discretized.
        tspace : `TensorSpace`
            Space providing containers for the values/coefficients of a
            discretized object.
        sampling : `Operator`, optional
            Operator mapping an `fspace` element to a `tspace` element.
            Must satisfy ``sampling.domain == fspace``,
            ``sampling.range == tspace``.
        interpol : `Operator`, optional
            Operator mapping a `tspace` element to an `fspace` element.
            Must satisfy ``interpol.domain == tspace``,
            ``interpol.range == fspace``.