Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
calgray committed Dec 6, 2021
1 parent 55ad472 commit 2a8bd2f
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions daliuge-engine/dlg/apps/pyfunc.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def import_using_code(code):
return dill.loads(code)


#
##
# @brief PyFuncApp
# @details An application that wraps a simple python function.
# The inputs of the application are treated as the arguments of the function.
Expand Down Expand Up @@ -187,10 +187,10 @@ def initialize(self, **kwargs):
else:
self.fdefaults = self.func_defaults

print(f"Default values for function {self.func_name}: {self.fdefaults}")
logger.debug(f"Default values for function {self.func_name}: {self.fdefaults}")

# Mapping between argument name and input drop uids
print(f"Input mapping: {self.func_arg_mapping}")
logger.debug(f"Input mapping: {self.func_arg_mapping}")

def run(self):

Expand All @@ -214,12 +214,11 @@ def run(self):
for name, uid in self.func_arg_mapping.items()
if name in self.fdefaults or name not in argnames
}
kwargs.merge(self.fdefaults)

# The rest of the inputs are the positional arguments
args = list(inputs.values())

print(f"Running {self.func_name} with args={args}, kwargs={kwargs}")
logger.debug(f"Running {self.func_name} with args={args}, kwargs={kwargs}")
result = self.f(*args, **kwargs)

# Depending on how many outputs we have we treat our result
Expand Down

0 comments on commit 2a8bd2f

Please sign in to comment.