aboutsummaryrefslogtreecommitdiff
path: root/wqflask/utility/helper_functions.py
diff options
context:
space:
mode:
authorBonfaceKilz2021-04-23 17:35:54 +0300
committerBonfaceKilz2021-04-23 17:42:26 +0300
commitd66a8d2ccbf10b53b31ef094835c5ba8ec672a68 (patch)
tree87fa5e1e109038412c5740b85e57ce23e2db6242 /wqflask/utility/helper_functions.py
parent8bad987466203baed948ba761d248e24f04ca49c (diff)
downloadgenenetwork2-d66a8d2ccbf10b53b31ef094835c5ba8ec672a68.tar.gz
Apply PEP-8
Diffstat (limited to 'wqflask/utility/helper_functions.py')
-rw-r--r--wqflask/utility/helper_functions.py28
1 files changed, 17 insertions, 11 deletions
diff --git a/wqflask/utility/helper_functions.py b/wqflask/utility/helper_functions.py
index 4ba92ed5..e0ae3414 100644
--- a/wqflask/utility/helper_functions.py
+++ b/wqflask/utility/helper_functions.py
@@ -4,19 +4,23 @@ from base.species import TheSpecies
from utility import hmac
-from flask import Flask, g
+from flask import g
import logging
-logger = logging.getLogger(__name__ )
+logger = logging.getLogger(__name__)
+
def get_species_dataset_trait(self, start_vars):
if "temp_trait" in list(start_vars.keys()):
- if start_vars['temp_trait'] == "True":
- self.dataset = data_set.create_dataset(dataset_name = "Temp", dataset_type = "Temp", group_name = start_vars['group'])
- else:
- self.dataset = data_set.create_dataset(start_vars['dataset'])
+ if start_vars['temp_trait'] == "True":
+ self.dataset = data_set.create_dataset(
+ dataset_name="Temp",
+ dataset_type="Temp",
+ group_name=start_vars['group'])
+ else:
+ self.dataset = data_set.create_dataset(start_vars['dataset'])
else:
- self.dataset = data_set.create_dataset(start_vars['dataset'])
+ self.dataset = data_set.create_dataset(start_vars['dataset'])
logger.debug("After creating dataset")
self.species = TheSpecies(dataset=self.dataset)
logger.debug("After creating species")
@@ -35,15 +39,17 @@ def get_trait_db_obs(self, trait_db_list):
for trait in trait_db_list:
data, _separator, hmac_string = trait.rpartition(':')
data = data.strip()
- assert hmac_string==hmac.hmac_creation(data), "Data tampering?"
+ assert hmac_string == hmac.hmac_creation(data), "Data tampering?"
trait_name, dataset_name = data.split(":")
if dataset_name == "Temp":
- dataset_ob = data_set.create_dataset(dataset_name=dataset_name, dataset_type="Temp", group_name=trait_name.split("_")[2])
+ dataset_ob = data_set.create_dataset(
+ dataset_name=dataset_name, dataset_type="Temp",
+ group_name=trait_name.split("_")[2])
else:
dataset_ob = data_set.create_dataset(dataset_name)
trait_ob = create_trait(dataset=dataset_ob,
- name=trait_name,
- cellid=None)
+ name=trait_name,
+ cellid=None)
if trait_ob:
self.trait_list.append((trait_ob, dataset_ob))