Last active
November 15, 2019 17:02
-
-
Save yadudoc/31e8d38439789580b947a0fb39c9e275 to your computer and use it in GitHub Desktop.
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
@python_app | |
def square(x): | |
return x**2 | |
@python_app | |
def average(x): | |
return sum(x)/len(x) | |
output_list = [] | |
for i in range(1,5): | |
output_list.append(square(i)) | |
mean = average(output_list) | |
# Original <---------------------- | |
# Edits -----------------> | |
@python_app | |
def square(x): | |
return x**2 | |
# inputs is a special kwarg that allows parsl apps to take a collection of futures | |
# If you pass an app a list or dict of futures, parsl doesn't inspect the data structure to see if there are futures in it. | |
@python_app | |
def average(inputs=[]): | |
return sum(inputs)/len(inputs) | |
output_list = [] | |
for i in range(1,5): | |
output_list.append(square(i)) | |
mean = average(inputs=output_list) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment