Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions scripts/local.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
import os

from ancillary import list_recursive


def local_1(args):

"""local_1
args is the COINSTAC argument dictionary
"""
input_list = args["input"]
myFile = input_list["covariates"]

Expand All @@ -12,16 +15,16 @@ def local_1(args):

myval = list(map(int, myval))
computation_output = {
"output": {
"output_val": myval,
"computation_phase": 'local_1'
}
"output": {"output_val": myval, "computation_phase": "local_1"}
}

return computation_output


def start(PARAM_DICT):
"""start
entry point and control flow for remote computations
"""
PHASE_KEY = list(list_recursive(PARAM_DICT, "computation_phase"))

if not PHASE_KEY:
Expand Down
6 changes: 4 additions & 2 deletions scripts/remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,17 @@


def remote_1(args):

"""remote_1 aggregates the numeric input from local sites
args is the dictionary received from local sites
"""
input_list = args["input"]
myval = np.mean([input_list[site]["output_val"] for site in input_list])

computation_output = {"output": {"output_list": myval}, "success": True}
return computation_output


def start(PARAM_DICT):
"""start controls the work flow for the local nodes"""
PHASE_KEY = list(list_recursive(PARAM_DICT, "computation_phase"))

if "local_1" in PHASE_KEY:
Expand Down