-
Notifications
You must be signed in to change notification settings - Fork 105
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1011 from JosepSampe/lithops-dev
[Core] Reorganize serializer logic
- Loading branch information
Showing
4 changed files
with
51 additions
and
34 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
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,23 @@ | ||
""" | ||
Simple Lithops example using one single function invocation | ||
with a class as a function and a function as a parameter | ||
""" | ||
import lithops | ||
|
||
def mult(x, y): | ||
return x + y | ||
|
||
|
||
class MyClass: | ||
def __init__(self, base) -> None: | ||
self.base = base | ||
|
||
def __call__(self, x, fn) -> int: | ||
return fn(self.base, x) | ||
|
||
|
||
if __name__ == '__main__': | ||
fexec = lithops.FunctionExecutor() | ||
inst = MyClass(7) | ||
fexec.map(inst, [(8, mult), (6, mult)]) | ||
print(fexec.get_result()) |
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
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