Skip to content

Commit

Permalink
Merge branch 'master' into yan-1070
Browse files Browse the repository at this point in the history
  • Loading branch information
james-strauss-uwa committed Aug 15, 2022
2 parents 2aa51ce + 66dd9be commit 76c56bc
Show file tree
Hide file tree
Showing 5 changed files with 242 additions and 118 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/create-palettes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ jobs:
- name: Create palettes
run: |
python3 tools/xml2palette/xml2palette.py -i ./ -t daliuge -o $OUTPUT_FILENAME.palette -p
python3 tools/xml2palette/xml2palette.py -i ./ -t template -o $OUTPUT_FILENAME-template.palette -p
python3 tools/xml2palette/xml2palette.py -t daliuge -r ./ $OUTPUT_FILENAME.palette
python3 tools/xml2palette/xml2palette.py -t template -r ./ $OUTPUT_FILENAME-template.palette
- name: Commit palettes to EAGLE
env:
Expand Down
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
21 changes: 16 additions & 5 deletions docs/development/app_development/eagle_app_integration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,30 @@ The xml2palette.py script is located in the tools directory within the DALiuGE r

The xml2palette.py script can be run using this command line:

.. code-block:: none
.. code-block::
python3 xml2palette.py -i <path_to_input_directory> -t <tag> -o <path_output_file>
python3 xml2palette.py [-h] [-m MODULE] [-t TAG] [-c] [-r] [-s] [-v] idir ofile
positional arguments:
idir input directory path or file name
ofile output file name
If no tag is specified, all components found in the input directory will part of the output file. If, however, a tag is specified, then only those components with a matching tag will be part of the output. Tags can be added to the Doxygen comments for a component using:
optional arguments:
-h, --help show this help message and exit
-m MODULE, --module MODULE
Module load path name
-t TAG, --tag TAG filter components with matching tag
-c C mode, if not set Python will be used
-r, --recursive Traverse sub-directories
-s, --parse_all Try to parse non DAliuGE compliant functions and methods
-v, --verbose increase output verbosity
If no tag is specified, all components found in the input directory will part of the output file. If, however, a tag is specified, then only those components with a matching tag will be part of the output. Tags can be added to the Doxygen comments for a component using:
.. code-block:: python
# @param tag <tag_name>
There are also two optional arguments for xml2palette. Allow missing "EAGLE start" (-s) which allows xml2palette.py to run on code without any eagle-specific doxygen comments. Finally (-m) restricts xml2palette.py to produce a palette that only contains methods from within the specified module.

Component Doxygen Markup Guide
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
In order to support the direct usage of newly written application components in the EAGLE editor, the |daliuge| system supports a custom set of Doxygen directives and tools. When writing an application component, developers can add specific custom `Doxygen <https://www.doxygen.nl/>`_ comments to the source code. These comments describe the component and can be used to automatically generate a JSON DALiuGE component description which in turn can be used in the *EAGLE*. A few basic rules to remember:
Expand Down
Loading

0 comments on commit 76c56bc

Please sign in to comment.