Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Exr0n committed Oct 19, 2023
1 parent 5602e12 commit 609213b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 18 deletions.
11 changes: 1 addition & 10 deletions free_flow/lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
T = TypeVar('T')
W = TypeVar('W')

# def map(fn: Callable[[T], W]):
# pass

def Noop(x):
return x
Expand All @@ -35,20 +33,13 @@ def ret(x):

from segments import ff
# TODO: print the graph! https://github.com/pydot/pydot
# TODO: make a flatten utility? and a *apply utility? (eg. something turns arr into arr[arr], then i want to apply smt to each thing of the inner
# TODO: make a flatten utility?

if __name__ == '__main__':
x = ff('hello', eager=True)(
Inspect("initial"), T( Print,
[ord, lambda x: x**2 ]), Inspect("after tee"))








# data pipe:
# 'hello' --- print --- + --- print ----|

Expand Down
9 changes: 1 addition & 8 deletions free_flow/segments.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,6 @@ def __repr__(self):
class Segment(ABC):
def __init__(self):
pass
# self._eager = False
# @property
# def eager(self):
# return self._eager
# @eager.setter
# def eager(self, v: bool):
# self._eager = v

@abstractmethod
def __call__(self):
Expand Down Expand Up @@ -124,7 +117,7 @@ def __init__(self, *segs: List[Segment]): self.segs = segs
def __call__(self, x):
for f in self.segs:
try:
console.print(f"[green]{type(x).__name__}[/green] ➡️ {repr(f)}")
# console.print(f"[green]{type(x).__name__}[/green] ➡️ {repr(f)}")
x = f(x) # optm: add vectorizability
except Exception as e:
raise FlowError(e, f, x)
Expand Down

0 comments on commit 609213b

Please sign in to comment.