aboutsummaryrefslogtreecommitdiff
path: root/wqflask
diff options
context:
space:
mode:
authorMunyoki Kilyungi2022-09-08 14:20:30 +0300
committerBonfaceKilz2022-09-08 14:26:19 +0300
commit08a937631da94c8158068072d2ce2346c29e9cbe (patch)
tree954f5be5084d5c1f3ecd4dfc7ee22cb793c6e05f /wqflask
parent6abdd5ce8e76452a93613fa5477832bb0b3c3050 (diff)
downloadgenenetwork2-08a937631da94c8158068072d2ce2346c29e9cbe.tar.gz
Replace "asserts" with ValueErrors
* wqflask/wqflask/api/correlation.py (do_correlation): Raise a ValueError if variables are not in the start_vars.
Diffstat (limited to 'wqflask')
-rw-r--r--wqflask/wqflask/api/correlation.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/wqflask/wqflask/api/correlation.py b/wqflask/wqflask/api/correlation.py
index ab1e772a..9fafc881 100644
--- a/wqflask/wqflask/api/correlation.py
+++ b/wqflask/wqflask/api/correlation.py
@@ -8,9 +8,12 @@ from wqflask.correlation import correlation_functions
from wqflask.database import database_connection
def do_correlation(start_vars):
- assert('db' in start_vars)
- assert('target_db' in start_vars)
- assert('trait_id' in start_vars)
+ if 'db' not in start_vars:
+ raise ValueError("'db' not found!")
+ if 'target_db' not in start_vars:
+ raise ValueError("'target_db' not found!")
+ if 'trait_id' not in start_vars:
+ raise ValueError("'trait_id' not found!")
this_dataset = data_set.create_dataset(dataset_name=start_vars['db'])
target_dataset = data_set.create_dataset(