From 17a72093f829666cc6e8df722771d31066dd71d0 Mon Sep 17 00:00:00 2001 From: BonfaceKilz Date: Wed, 19 Aug 2020 03:24:27 +0300 Subject: Handle the move of reduce() to functools.reduce() Run `2to3-3.8 -f reduce -w .` See: --- wqflask/wqflask/correlation_matrix/show_corr_matrix.py | 6 +++++- wqflask/wqflask/marker_regression/display_mapping_results.py | 4 ++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/wqflask/wqflask/correlation_matrix/show_corr_matrix.py b/wqflask/wqflask/correlation_matrix/show_corr_matrix.py index a912344f..e6c817e7 100644 --- a/wqflask/wqflask/correlation_matrix/show_corr_matrix.py +++ b/wqflask/wqflask/correlation_matrix/show_corr_matrix.py @@ -42,6 +42,10 @@ import rpy2.robjects as robjects from pprint import pformat as pf from utility.redis_tools import get_redis_conn +try: # Only import this for Python3 + from functools import reduce +except: + pass Redis = get_redis_conn() THIRTY_DAYS = 60 * 60 * 24 * 30 @@ -302,4 +306,4 @@ def sortEigenVectors(vector): A = [x*100.0/sum for x in A] return [A, B] except: - return [] \ No newline at end of file + return [] diff --git a/wqflask/wqflask/marker_regression/display_mapping_results.py b/wqflask/wqflask/marker_regression/display_mapping_results.py index 0328ce85..c8b9c405 100644 --- a/wqflask/wqflask/marker_regression/display_mapping_results.py +++ b/wqflask/wqflask/marker_regression/display_mapping_results.py @@ -48,6 +48,10 @@ from base.webqtlConfig import TMPDIR, GENERATED_TEXT_DIR, GENERATED_IMAGE_DIR from utility.pillow_utils import draw_rotated_text, draw_open_polygon import utility.logger +try: # Only import this for Python3 + from functools import reduce +except: + pass logger = utility.logger.getLogger(__name__ ) RED = ImageColor.getrgb("red") -- cgit v1.2.3