aboutsummaryrefslogtreecommitdiff
path: root/wqflask/utility
diff options
context:
space:
mode:
Diffstat (limited to 'wqflask/utility')
-rw-r--r--wqflask/utility/Plot.py4
-rw-r--r--wqflask/utility/benchmark.py52
-rw-r--r--wqflask/utility/gen_geno_ob.py4
-rw-r--r--wqflask/utility/helper_functions.py3
-rw-r--r--wqflask/utility/logger.py1
-rw-r--r--wqflask/utility/pillow_utils.py3
-rw-r--r--wqflask/utility/redis_tools.py2
7 files changed, 1 insertions, 68 deletions
diff --git a/wqflask/utility/Plot.py b/wqflask/utility/Plot.py
index d4256a46..df7156b4 100644
--- a/wqflask/utility/Plot.py
+++ b/wqflask/utility/Plot.py
@@ -33,8 +33,7 @@ from math import *
import utility.corestats as corestats
from base import webqtlConfig
from utility.pillow_utils import draw_rotated_text
-import utility.logger
-logger = utility.logger.getLogger(__name__)
+
# ---- Define common colours ---- #
BLUE = ImageColor.getrgb("blue")
@@ -105,7 +104,6 @@ def find_outliers(vals):
"""
if vals:
- #logger.debug("vals is:", pf(vals))
stats = corestats.Stats(vals)
low_hinge = stats.percentile(25)
up_hinge = stats.percentile(75)
diff --git a/wqflask/utility/benchmark.py b/wqflask/utility/benchmark.py
deleted file mode 100644
index 6ece2f21..00000000
--- a/wqflask/utility/benchmark.py
+++ /dev/null
@@ -1,52 +0,0 @@
-import collections
-import inspect
-import time
-from utility.tools import LOG_BENCH
-
-from utility.logger import getLogger
-logger = getLogger(__name__)
-
-
-class Bench:
- entries = collections.OrderedDict()
-
- def __init__(self, name=None, write_output=LOG_BENCH):
- self.name = name
- self.write_output = write_output
-
- def __enter__(self):
- if self.write_output:
- if self.name:
- logger.debug("Starting benchmark: %s" % (self.name))
- else:
- logger.debug("Starting benchmark at: %s [%i]" % (
- inspect.stack()[1][3], inspect.stack()[1][2]))
- self.start_time = time.time()
-
- def __exit__(self, type, value, traceback):
- time_taken = time.time() - self.start_time
- if self.write_output:
- if self.name:
- name = self.name
- else:
- name = "That"
-
- logger.info(" %s took: %f seconds" % (name, (time_taken)))
-
- if self.name:
- Bench.entries[self.name] = Bench.entries.get(
- self.name, 0) + time_taken
-
- @classmethod
- def report(cls):
- total_time = sum(
- (time_taken for time_taken in list(cls.entries.values())))
- print("\nTiming report\n")
- for name, time_taken in list(cls.entries.items()):
- percent = int(round((time_taken / total_time) * 100))
- print("[{}%] {}: {}".format(percent, name, time_taken))
- print()
-
- def reset(cls):
- """Reset the entries"""
- cls.entries = collections.OrderedDict()
diff --git a/wqflask/utility/gen_geno_ob.py b/wqflask/utility/gen_geno_ob.py
index e619b7b6..c7a1ea59 100644
--- a/wqflask/utility/gen_geno_ob.py
+++ b/wqflask/utility/gen_geno_ob.py
@@ -1,7 +1,3 @@
-import utility.logger
-logger = utility.logger.getLogger(__name__)
-
-
class genotype:
"""
Replacement for reaper.Dataset so we can remove qtlreaper use while still generating mapping output figure
diff --git a/wqflask/utility/helper_functions.py b/wqflask/utility/helper_functions.py
index 27dd0729..4229a91f 100644
--- a/wqflask/utility/helper_functions.py
+++ b/wqflask/utility/helper_functions.py
@@ -6,9 +6,6 @@ from utility import hmac
from flask import g
-import logging
-logger = logging.getLogger(__name__)
-
def get_species_dataset_trait(self, start_vars):
if "temp_trait" in list(start_vars.keys()):
diff --git a/wqflask/utility/logger.py b/wqflask/utility/logger.py
index d706e32a..65f2f1ee 100644
--- a/wqflask/utility/logger.py
+++ b/wqflask/utility/logger.py
@@ -27,7 +27,6 @@
# We'll add more overrides soon.
import logging
-import string
from inspect import isfunction
from pprint import pformat as pf
from inspect import stack
diff --git a/wqflask/utility/pillow_utils.py b/wqflask/utility/pillow_utils.py
index 5713e155..e302df18 100644
--- a/wqflask/utility/pillow_utils.py
+++ b/wqflask/utility/pillow_utils.py
@@ -2,9 +2,6 @@ from PIL import Image, ImageColor, ImageDraw, ImageFont
from utility.tools import TEMPDIR
-import utility.logger
-logger = utility.logger.getLogger(__name__)
-
BLACK = ImageColor.getrgb("black")
WHITE = ImageColor.getrgb("white")
diff --git a/wqflask/utility/redis_tools.py b/wqflask/utility/redis_tools.py
index 641d973e..945efbbd 100644
--- a/wqflask/utility/redis_tools.py
+++ b/wqflask/utility/redis_tools.py
@@ -5,8 +5,6 @@ import datetime
import redis # used for collections
from utility.hmac import hmac_creation
-from utility.logger import getLogger
-logger = getLogger(__name__)
def get_redis_conn():