diff options
author | Munyoki Kilyungi | 2022-09-01 16:00:02 +0300 |
---|---|---|
committer | BonfaceKilz | 2022-09-05 12:20:19 +0300 |
commit | 1551c890f652ddf2cd9ca260b84765e4ccde2318 (patch) | |
tree | e15029ef95f2c98f25e9977b14ebdb8fbbca5fc3 | |
parent | e0176f3e0378c4c7dbf31f7dd209001139bc6744 (diff) | |
download | genenetwork2-1551c890f652ddf2cd9ca260b84765e4ccde2318.tar.gz |
Replace "assert" with ValueError
* wqflask/wqflask/api/mapping.py (do_mapping_for_api): Raise a
ValueError if 'db' and 'trait_id' or not present in 'start_vars'
instead of doing an "assert".
-rw-r--r-- | wqflask/wqflask/api/mapping.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/wqflask/wqflask/api/mapping.py b/wqflask/wqflask/api/mapping.py index 94e37161..0a23457e 100644 --- a/wqflask/wqflask/api/mapping.py +++ b/wqflask/wqflask/api/mapping.py @@ -5,8 +5,8 @@ from wqflask.marker_regression import gemma_mapping, rqtl_mapping from wqflask.show_trait.show_trait import normf def do_mapping_for_api(start_vars): - assert('db' in start_vars) - assert('trait_id' in start_vars) + if ('db' not in start_vars) or ("trait_id" not in start_vars): + raise ValueError("Mapping: db and trait_id are not in start_vars") dataset = data_set.create_dataset(dataset_name=start_vars['db']) dataset.group.get_markers() |