diff options
-rw-r--r-- | wqflask/wqflask/ctl/gn3_ctl_analysis.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/wqflask/wqflask/ctl/gn3_ctl_analysis.py b/wqflask/wqflask/ctl/gn3_ctl_analysis.py index d44f8bf0..2b5c0f0b 100644 --- a/wqflask/wqflask/ctl/gn3_ctl_analysis.py +++ b/wqflask/wqflask/ctl/gn3_ctl_analysis.py @@ -3,6 +3,20 @@ import requests from utility.tools import GN3_LOCAL_URL +def parse_form_data(form_data: dict): + """function to parse/validate form data + input: dict containing required data + output: dict with parsed data + + """ + + form_data["nperm"] = int(form_data["nperm"]) + form_data["significance"] = float(int(form_data["significance"])) + form_data["strategy"] = form_data["strategy"].capitalize() + + return form_data + + def run_ctl(): """function to make an api call to gn3 and run ctl""" |