chebpy/chebpy

View on GitHub
chebpy/core/fun.py

Summary

Maintainability
B
4 hrs
Test Coverage
from abc import ABC, abstractmethod, abstractclassmethod


class Fun(ABC):
    # --------------------------
    #  alternative constructors
    # --------------------------
    @abstractclassmethod
    def initconst(cls):
        raise NotImplementedError

    @abstractclassmethod
    def initempty(cls):
        raise NotImplementedError

    @abstractclassmethod
    def initfun_adaptive(cls):
        raise NotImplementedError

    @abstractclassmethod
    def initfun_fixedlen(cls):
        raise NotImplementedError

    # -------------------
    #  "private" methods
    # -------------------
    @abstractmethod
    def __add__(self):
        raise NotImplementedError

    @abstractmethod
    def __call__(self):
        raise NotImplementedError

    @abstractmethod
    def __init__(self):
        raise NotImplementedError

    @abstractmethod
    def __mul__(self):
        raise NotImplementedError

    @abstractmethod
    def __neg__(self):
        raise NotImplementedError

    @abstractmethod
    def __pos__(self):
        raise NotImplementedError

    @abstractmethod
    def __pow__(self):
        raise NotImplementedError

    @abstractmethod
    def __radd__(self):
        raise NotImplementedError

    @abstractmethod
    def __repr__(self):
        raise NotImplementedError

    @abstractmethod
    def __rmul__(self):
        raise NotImplementedError

    @abstractmethod
    def __rsub__(self):
        raise NotImplementedError

    @abstractmethod
    def __sub__(self):
        raise NotImplementedError

    # ------------
    #  properties
    # ------------
    @property
    @abstractmethod
    def coeffs(self):
        raise NotImplementedError

    @property
    @abstractmethod
    def interval(self):
        raise NotImplementedError

    @property
    @abstractmethod
    def isconst(self):
        raise NotImplementedError

    @property
    @abstractmethod
    def isempty(self):
        raise NotImplementedError

    @property
    @abstractmethod
    def iscomplex(self):
        raise NotImplementedError

    @property
    @abstractmethod
    def size(self):
        raise NotImplementedError

    @property
    @abstractmethod
    def support(self):
        raise NotImplementedError

    @property
    @abstractmethod
    def vscale(self):
        raise NotImplementedError

    # -----------
    #  utilities
    # -----------
    @abstractmethod
    def copy(self):
        raise NotImplementedError

    @abstractmethod
    def imag(self):
        raise NotImplementedError

    @abstractmethod
    def real(self):
        raise NotImplementedError

    @abstractmethod
    def restrict(self):
        raise NotImplementedError

    @abstractmethod
    def simplify(self):
        raise NotImplementedError

    @abstractmethod
    def values(self):
        raise NotImplementedError

    # -------------
    #  rootfinding
    # -------------
    @abstractmethod
    def roots(self):
        raise NotImplementedError

    # ----------
    #  calculus
    # ----------
    @abstractmethod
    def cumsum(self):
        raise NotImplementedError

    @abstractmethod
    def diff(self):
        raise NotImplementedError

    @abstractmethod
    def sum(self):
        raise NotImplementedError