Skip to content

Commit

Permalink
Merge pull request #101 from ICRAR/YAN-853
Browse files Browse the repository at this point in the history
YAN-853 DataDROP type and add data components guide
  • Loading branch information
awicenec committed Feb 7, 2022
2 parents e741689 + 7900014 commit 07654d4
Show file tree
Hide file tree
Showing 23 changed files with 802 additions and 92 deletions.
23 changes: 13 additions & 10 deletions daliuge-engine/dlg/apps/simple.py
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ def averageArray(self):
# @param[in] param/function Function/sum/String/readwrite/
# \~English The function used for gathering
# @param[in] param/function reduce_axes/None/String/readonly/
# \~English Application class
# \~English The ndarray axes to reduce, None reduces all axes for sum, prod, max, min functions
# @param[in] port/array Array/npy/
# \~English Port for the input array(s)
# @param[out] port/array Array/npy/
Expand All @@ -332,7 +332,8 @@ def averageArray(self):
class GenericNpyGatherApp(BarrierAppDROP):
"""
A BarrierAppDrop that reduces then gathers one or more inputs using cummulative operations.
function: string <['sum']|'prod'|'min'|'max'>.
function: string <['sum']|'prod'|'min'|'max'|'add'|'multiply'|'maximum'|'minimum'>.
"""
component_meta = dlg_component(
"GenericNpyGatherApp",
Expand All @@ -345,16 +346,18 @@ class GenericNpyGatherApp(BarrierAppDROP):
# reduce and combine operation pair names
functions = {
# reduce and gather e.g. output dimension is reduces
"sum": "add",
"prod": "multiply",
"max": "maximum",
"min": "minimum",

"sum": "add", # sum reduction of inputs along an axis first then reduces across drops
"prod": "multiply", # prod reduction of inputs along an axis first then reduces across drops
"max": "maximum", # max reduction of input along an axis first then reduces across drops
"min": "minimum", # min reduction of input along an axis first then reduces across drops

# gather only
"add": None,
"multiply": None,
"maximum": None,
"minimum": None
"add": None, # elementwise addition of inputs, ndarrays must be of same shape
"multiply": None, # elementwise multiplication of inputs, ndarrays must be of same shape
"maximum": None, # elementwise maximums of inputs, ndarrays must be of same shape
"minimum": None # elementwise minimums of inputs, ndarrays must be of same shape

}
function: str = dlg_string_param("function", "sum")
reduce_axes: str = dlg_string_param("reduce_axes", "None")
Expand Down
Loading

0 comments on commit 07654d4

Please sign in to comment.