Skip to content

Commit

Permalink
changes to accommodate casatasks palette generation
Browse files Browse the repository at this point in the history
  • Loading branch information
awicenec committed Aug 12, 2022
1 parent 5ebddd9 commit 4227874
Show file tree
Hide file tree
Showing 3 changed files with 219 additions and 75 deletions.
16 changes: 11 additions & 5 deletions daliuge-engine/dlg/apps/pyfunc.py
Original file line number Diff line number Diff line change
Expand Up @@ -433,10 +433,16 @@ def optionalEval(x):
# the correct UIDs
logger.debug(f"Parameters found: {self.parameters}")
posargs = self.arguments.args[:self.fn_npos]
keyargs = self.arguments.args[self.fn_npos:]
kwargs = {}
pargs = []
# Initialize pargs dictionary and update with provided argument values
pargsDict = collections.OrderedDict(zip(posargs,[None]*len(posargs)))
if self.arguments.defaults:
keyargsDict = dict(zip(keyargs, self.arguments.defaults[self.fn_npos:]))
else:
keyargsDict = {}
logger.debug("Initial keyargs dictionary: %s", keyargsDict)
if "applicationArgs" in self.parameters:
appArgs = self.parameters["applicationArgs"] # we'll pop the identified ones
_dum = [appArgs.pop(k) for k in self.func_def_keywords if k in appArgs]
Expand Down Expand Up @@ -465,16 +471,13 @@ def optionalEval(x):
inputs_dict,
posargs,
pargsDict,
appArgs,
keyargsDict,
check_len=check_len,
mode="inputs"))
else:
for i in range(min(len(inputs),self.fn_nargs)):
kwargs.update({self.arguments.args[i]: list(inputs.values())[i]})

logger.debug(f"Updating funcargs with input ports {kwargs}")
funcargs.update(kwargs)

if ('outputs' in self.parameters and
droputils.check_ports_dict(self.parameters['outputs'])):
check_len = min(len(outputs),self.fn_nargs+
Expand All @@ -491,9 +494,12 @@ def optionalEval(x):
outputs_dict,
posargs,
pargsDict,
appArgs,
keyargsDict,
check_len=check_len,
mode="outputs"))
logger.debug(f"Updating funcargs with input ports {kwargs}")
funcargs.update(kwargs)


# Try to get values for still missing positional arguments from Application Args
if "applicationArgs" in self.parameters:
Expand Down
3 changes: 1 addition & 2 deletions daliuge-engine/dlg/apps/scp.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@

##
# @brief ScpApp
# @details A BarrierAppDROP that copies the content of its single input onto its
# single output via SSH's scp protocol.
# @details A BarrierAppDROP that copies the content of its single input onto its single output via SSH's scp protocol.
# @par EAGLE_START
# @param category PythonApp
# @param tag daliuge
Expand Down

0 comments on commit 4227874

Please sign in to comment.