diff --git a/scripts/local.py b/scripts/local.py index 5abe761..6f6447e 100644 --- a/scripts/local.py +++ b/scripts/local.py @@ -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"] @@ -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: diff --git a/scripts/remote.py b/scripts/remote.py index 895dd80..896f69f 100644 --- a/scripts/remote.py +++ b/scripts/remote.py @@ -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: