Skip to content

Commit

Permalink
Merge branch 'dev' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
carlos-adir committed Jul 4, 2023
2 parents a2c7903 + 853711c commit 5daf09f
Show file tree
Hide file tree
Showing 18 changed files with 2,493 additions and 2,839 deletions.
10 changes: 10 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[report]
exclude_lines =
# Skip any pass lines such as may be used for @abstractmethod
pass

# Have to re-enable the standard pragma
pragma: no cover

# Don't complain if tests don't hit defensive assertion code:
raise NotImplementedError
105 changes: 105 additions & 0 deletions examples/examples1.ipynb

Large diffs are not rendered by default.

117 changes: 117 additions & 0 deletions examples/examples2.ipynb

Large diffs are not rendered by default.

124 changes: 124 additions & 0 deletions examples/examples3.ipynb

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "compmec-nurbs"
version = "1.0.2"
version = "1.0.3"
description = ""
readme = "README.md"
authors = ["Carlos Adir <carlos.adir@gmail.com>"]
Expand Down
36 changes: 17 additions & 19 deletions src/compmec/nurbs/__classes__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import numpy as np


class Interface_KnotVector(abc.ABC):
class Intface_KnotVector(abc.ABC):
@abc.abstractproperty
def degree(self) -> int:
raise NotImplementedError
Expand All @@ -22,7 +22,7 @@ def verify_valid_span(self, u: Tuple[float]):
raise NotImplementedError

@abc.abstractmethod
def span(self, u: Union[float, np.ndarray]) -> Union[int, np.ndarray]:
def span(self, knot: np.ndarray) -> np.ndarray:
raise NotImplementedError

@abc.abstractmethod
Expand All @@ -37,31 +37,32 @@ def remove_knot(self, knot: float, times: Optional[int] = 1):
def __eq__(self, obj: object) -> bool:
raise NotImplementedError

@abc.abstractmethod
def __ne__(self, obj: object) -> bool:
return not self.__eq__(obj)
raise NotImplementedError


class Interface_BaseFunction_Evaluator_BaseCurve(abc.ABC):
class Intface_BaseFunction_Evaluator_BaseCurve(abc.ABC):
@abc.abstractproperty
def knotvector(self) -> Interface_KnotVector:
def knotvector(self) -> Intface_KnotVector:
raise NotImplementedError

@abc.abstractmethod
def __call__(self, u: Union[float, np.ndarray]) -> Union[float, np.ndarray]:
def __call__(self, u: np.ndarray) -> np.ndarray:
raise NotImplementedError


class Interface_Evaluator(Interface_BaseFunction_Evaluator_BaseCurve):
class Intface_Evaluator(Intface_BaseFunction_Evaluator_BaseCurve):
@abc.abstractproperty
def first_index(self) -> Union[int, slice]:
raise NotImplementedError

@abc.abstractproperty
def first_index(self) -> Union[int, slice]:
def second_index(self) -> Union[int, slice]:
raise NotImplementedError


class Interface_BaseFunction_BaseCurve(Interface_BaseFunction_Evaluator_BaseCurve):
class Intface_BaseFunction_BaseCurve(Intface_BaseFunction_Evaluator_BaseCurve):
@abc.abstractproperty
def degree(self) -> int:
raise NotImplementedError
Expand All @@ -78,28 +79,24 @@ def knot_insert(self, knot: float, times: Optional[int] = 1):
def knot_remove(self, knot: float, times: Optional[int] = 1):
raise NotImplementedError

@abc.abstractmethod
def derivate(self):
raise NotImplementedError


class Interface_BaseFunction(Interface_BaseFunction_BaseCurve):
class Intface_BaseFunction(Intface_BaseFunction_BaseCurve):
@abc.abstractmethod
def __init__(self, knotvector: Interface_KnotVector):
def __init__(self, knotvector: Intface_KnotVector):
raise NotImplementedError

@abc.abstractmethod
def __getitem__(self, tup: Any) -> Union[float, np.ndarray]:
raise NotImplementedError


class Interface_BaseCurve(Interface_BaseFunction_BaseCurve):
class Intface_BaseCurve(Intface_BaseFunction_BaseCurve):
@abc.abstractmethod
def __init__(self, knotvector: Interface_KnotVector, ctrlpoints: np.ndarray):
def __init__(self, knotvector: Intface_KnotVector, ctrlpoints: np.ndarray):
raise NotImplementedError

@abc.abstractproperty
def F(self) -> Interface_BaseFunction:
def F(self) -> Intface_BaseFunction:
raise NotImplementedError

@abc.abstractproperty
Expand All @@ -110,5 +107,6 @@ def ctrlpoints(self) -> np.ndarray:
def __eq__(self, obj: object) -> bool:
raise NotImplementedError

@abc.abstractmethod
def __ne__(self, obj: object) -> bool:
return not self.__eq__(obj)
raise NotImplementedError
4 changes: 2 additions & 2 deletions src/compmec/nurbs/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
__version__ = "1.0.2"
__version__ = "1.0.3"

from compmec.nurbs.basefunctions import RationalBaseFunction, SplineBaseFunction
from compmec.nurbs.curves import RationalCurve, SplineCurve
from compmec.nurbs.functions import RationalFunction, SplineFunction
from compmec.nurbs.knotspace import GeneratorKnotVector, KnotVector
Loading

0 comments on commit 5daf09f

Please sign in to comment.