forked from swyddfa/arlunio
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
47 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,21 @@ | ||
from .color import FillColor # noqa: F401 | ||
from .domain.transform import ( # noqa: F401 | ||
horizontal_shear, | ||
rotate, | ||
translate, | ||
vertical_shear, | ||
) | ||
from .image import LayeredImage, SimpleImage # noqa: F401 | ||
from .math import anded, lerp # noqa: F401 | ||
from .shape import ( # noqa: F401 | ||
Circle, | ||
Ellipse, | ||
ImplicitXY, | ||
Rectangle, | ||
Shape, | ||
Square, | ||
Triangle, | ||
) | ||
from .time import Timeline # noqa: F401 | ||
|
||
from ._version import __version__ # noqa: F401 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
from .logic import anded # noqa: F401 | ||
from .interpolation import lerp # noqa: F401 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import numpy as np | ||
|
||
|
||
class LogicalAnd: | ||
"""Represents a logical AND between N values. | ||
Yes, there is currently no reason to use a class but where I want to | ||
take this in the near future will require a class. | ||
""" | ||
|
||
def __init__(self, values): | ||
self.values = values | ||
|
||
def __call__(self): | ||
|
||
result = True | ||
|
||
for v in self.values: | ||
result = np.logical_and(result, v) | ||
|
||
return result | ||
|
||
|
||
def anded(*args): | ||
logical_and = LogicalAnd(args) | ||
return logical_and() |