def __init__(self, domain_range=None, n_basis=None, order=4, knots=None):
    'Bspline basis constructor.\n\n        Args:\n            domain_range (tuple, optional): Definition of the interval where\n                the basis defines a space. Defaults to (0,1) if knots are not\n                specified. If knots are specified defaults to the first and\n                last element of the knots.\n            n_basis (int, optional): Number of splines that form the basis.\n            order (int, optional): Order of the splines. One greater that\n                their degree. Defaults to 4 which mean cubic splines.\n            knots (array_like): List of knots of the splines. If domain_range\n                is specified the first and last elements of the knots have to\n                match with it.\n\n        '
    if (domain_range is not None):
        domain_range = _domain_range(domain_range)
        if (len(domain_range) != 1):
            raise ValueError('Domain range should be unidimensional.')
        domain_range = domain_range[0]
    if (knots is None):
        if (n_basis is None):
            raise ValueError('Must provide either a list of knots or thenumber of basis.')
    else:
        knots = tuple(knots)
        knots = sorted(knots)
        if (domain_range is None):
            domain_range = (knots[0], knots[(- 1)])
        elif ((domain_range[0] != knots[0]) or (domain_range[1] != knots[(- 1)])):
            raise ValueError('The ends of the knots must be the same as the domain_range.')
    if (n_basis is None):
        n_basis = ((len(knots) + order) - 2)
    if (((n_basis - order) + 2) < 2):
        raise ValueError(f'The number of basis ({n_basis}) minus the order of the bspline ({order}) should be greater than 3.')
    self._order = order
    self._knots = (None if (knots is None) else tuple(knots))
    super().__init__(domain_range=domain_range, n_basis=n_basis)
    if (self.n_basis != ((self.order + len(self.knots)) - 2)):
        raise ValueError(f'The number of basis ({self.n_basis}) has to equal the order ({self.order}) plus the number of knots ({len(self.knots)}) minus 2.')
Bspline basis constructor.

Args:
    domain_range (tuple, optional): Definition of the interval where
        the basis defines a space. Defaults to (0,1) if knots are not
        specified. If knots are specified defaults to the first and
        last element of the knots.
    n_basis (int, optional): Number of splines that form the basis.
    order (int, optional): Order of the splines. One greater that
        their degree. Defaults to 4 which mean cubic splines.
    knots (array_like): List of knots of the splines. If domain_range
        is specified the first and last elements of the knots have to
        match with it.
def __init__(self, domain_range=None, n_basis=None, order=4, knots=None):
    'Bspline basis constructor.\n\n        Args:\n            domain_range (tuple, optional): Definition of the interval where\n                the basis defines a space. Defaults to (0,1) if knots are not\n                specified. If knots are specified defaults to the first and\n                last element of the knots.\n            n_basis (int, optional): Number of splines that form the basis.\n            order (int, optional): Order of the splines. One greater that\n                their degree. Defaults to 4 which mean cubic splines.\n            knots (array_like): List of knots of the splines. If domain_range\n                is specified the first and last elements of the knots have to\n                match with it.\n\n        '
    if (domain_range is not None):
        domain_range = _domain_range(domain_range)
        if (len(domain_range) != 1):
            raise ValueError('Domain range should be unidimensional.')
        domain_range = domain_range[0]
    if (knots is None):
        if (n_basis is None):
            raise ValueError('Must provide either a list of knots or thenumber of basis.')
    else:
        knots = tuple(knots)
        knots = sorted(knots)
        if (domain_range is None):
            domain_range = (knots[0], knots[(- 1)])
        elif ((domain_range[0] != knots[0]) or (domain_range[1] != knots[(- 1)])):
            raise ValueError('The ends of the knots must be the same as the domain_range.')
    if (n_basis is None):
        n_basis = ((len(knots) + order) - 2)
    if (((n_basis - order) + 2) < 2):
        raise ValueError(f'The number of basis ({n_basis}) minus the order of the bspline ({order}) should be greater than 3.')
    self._order = order
    self._knots = (None if (knots is None) else tuple(knots))
    super().__init__(domain_range=domain_range, n_basis=n_basis)
    if (self.n_basis != ((self.order + len(self.knots)) - 2)):
        raise ValueError(f'The number of basis ({self.n_basis}) has to equal the order ({self.order}) plus the number of knots ({len(self.knots)}) minus 2.')