From 1d34c15ddafc516dfaf6064f4fad2bf09795d5ed Mon Sep 17 00:00:00 2001 From: Alexander Kabui Date: Wed, 19 Jan 2022 12:58:10 +0300 Subject: parse input data --- wqflask/wqflask/ctl/gn3_ctl_analysis.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) 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""" -- cgit v1.2.3