From eef56387e8de5730b6eb2c7d9d61508d83119631 Mon Sep 17 00:00:00 2001 From: Munyoki Kilyungi Date: Mon, 5 Sep 2022 10:26:28 +0300 Subject: Delete dead imports * wqflask/base/data_set.py: Remove un-used imports. * wqflask/base/trait.py: Ditto. wqflask/tests/wqflask/show_trait/test_show_trait.py: Ditto. * wqflask/wqflask/show_trait/show_trait.py: Ditto. * wqflask/wqflask/views: Ditto. --- wqflask/base/data_set.py | 10 ++-------- wqflask/base/trait.py | 3 --- wqflask/tests/wqflask/show_trait/test_show_trait.py | 1 - wqflask/wqflask/show_trait/show_trait.py | 3 --- wqflask/wqflask/views.py | 19 +------------------ 5 files changed, 3 insertions(+), 33 deletions(-) diff --git a/wqflask/base/data_set.py b/wqflask/base/data_set.py index ade38131..41c94078 100644 --- a/wqflask/base/data_set.py +++ b/wqflask/base/data_set.py @@ -21,8 +21,7 @@ from dataclasses import dataclass from dataclasses import field from dataclasses import InitVar from typing import Optional, Dict, List -from utility.tools import USE_GN_SERVER, USE_REDIS, flat_files, flat_file_exists, GN2_BASE_URL -from pprint import pformat as pf +from utility.tools import USE_REDIS, flat_file_exists, GN2_BASE_URL from utility.db_tools import escape from utility.db_tools import mescape from utility.db_tools import create_in_clause @@ -34,27 +33,22 @@ from utility import webqtlUtil from db import webqtlDatabaseFunction from base import species from base import webqtlConfig -from flask import Flask, g from base.webqtlConfig import TMPDIR from urllib.parse import urlparse from utility.tools import SQL_URI from wqflask.database import database_connection import os import math -import string import collections import codecs import json import requests -import gzip import pickle as pickle -import itertools import hashlib -import datetime - from redis import Redis + r = Redis() # Used by create_database to instantiate objects diff --git a/wqflask/base/trait.py b/wqflask/base/trait.py index 26aa687a..21575230 100644 --- a/wqflask/base/trait.py +++ b/wqflask/base/trait.py @@ -5,13 +5,10 @@ from wqflask import app from base import webqtlConfig from base.webqtlCaseData import webqtlCaseData from base.data_set import create_dataset -from utility import hmac from utility.authentication_tools import check_resource_availability from utility.tools import GN2_BASE_URL, GN_PROXY_URL from utility.redis_tools import get_redis_conn, get_resource_id -from utility.db_tools import escape - from flask import g, request, url_for from wqflask.database import database_connection diff --git a/wqflask/tests/wqflask/show_trait/test_show_trait.py b/wqflask/tests/wqflask/show_trait/test_show_trait.py index 63df2ba5..3f2afee3 100644 --- a/wqflask/tests/wqflask/show_trait/test_show_trait.py +++ b/wqflask/tests/wqflask/show_trait/test_show_trait.py @@ -10,7 +10,6 @@ from wqflask.show_trait.show_trait import get_categorical_variables from wqflask.show_trait.show_trait import get_trait_units from wqflask.show_trait.show_trait import get_nearest_marker from wqflask.show_trait.show_trait import get_genotype_scales -from wqflask.show_trait.show_trait import requests from wqflask.show_trait.show_trait import get_scales_from_genofile diff --git a/wqflask/wqflask/show_trait/show_trait.py b/wqflask/wqflask/show_trait/show_trait.py index b12b6ba0..f7dbf8df 100644 --- a/wqflask/wqflask/show_trait/show_trait.py +++ b/wqflask/wqflask/show_trait/show_trait.py @@ -18,13 +18,10 @@ from wqflask.show_trait.SampleList import SampleList from base.trait import create_trait from base import data_set from utility import helper_functions -from utility.authentication_tools import check_owner_or_admin from utility.tools import locate_ignore_error from utility.tools import GN_PROXY_URL from utility.redis_tools import get_redis_conn, get_resource_id -from gn3.authentication import AdminRole -from gn3.authentication import DataRole from gn3.authentication import get_highest_user_access_role Redis = get_redis_conn() diff --git a/wqflask/wqflask/views.py b/wqflask/wqflask/views.py index acd65587..ee640726 100644 --- a/wqflask/wqflask/views.py +++ b/wqflask/wqflask/views.py @@ -22,32 +22,19 @@ from zipfile import ZIP_DEFLATED from wqflask import app -from gn3.commands import run_cmd from gn3.computations.gemma import generate_hash_of_string -from gn3.db import diff_from_dict -from gn3.db import insert -from gn3.db import update -from gn3.db.metadata_audit import MetadataAudit -from gn3.db.phenotypes import Phenotype -from gn3.db.phenotypes import Probeset -from gn3.db.phenotypes import Publication - from flask import current_app from flask import g -from flask import flash from flask import Response from flask import request from flask import make_response from flask import render_template from flask import send_from_directory from flask import redirect -from flask import url_for from flask import send_file -from flask import jsonify # Some of these (like collect) might contain endpoints, so they're still used. # Blueprints should probably be used instead. -from wqflask import collect from wqflask import search_results from wqflask import server_side from base.data_set import create_dataset # Used by YAML in marker_regression @@ -68,7 +55,6 @@ from wqflask.correlation.rust_correlation import compute_correlation_rust from wqflask.correlation_matrix import show_corr_matrix from wqflask.correlation import corr_scatter_plot # from wqflask.wgcna import wgcna_analysis -from wqflask.ctl import ctl_analysis from wqflask.ctl.gn3_ctl_analysis import run_ctl from wqflask.wgcna.gn3_wgcna import run_wgcna @@ -90,13 +76,10 @@ from utility.tools import GN_VERSION from utility.tools import JS_TWITTER_POST_FETCHER_PATH from utility.tools import JS_GUIX_PATH from utility.helper_functions import get_species_groups -from utility.authentication_tools import check_resource_availability from utility.redis_tools import get_redis_conn -from base.webqtlConfig import GENERATED_IMAGE_DIR, DEFAULT_PRIVILEGES - -from pprint import pformat as pf +from base.webqtlConfig import GENERATED_IMAGE_DIR Redis = get_redis_conn() -- cgit v1.2.3