aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2023-11-15 09:29:00 +0300
committerFrederick Muriuki Muriithi2023-11-15 09:29:00 +0300
commitaae9d6d988867b9b3edba800857830b48668599c (patch)
treeeb438bb45cea3a63e68e9470afce58b47dd64b4c
parentfcd4b6fac4296d2b6975e1504dd57d7fc59d3dd5 (diff)
downloadgn-uploader-aae9d6d988867b9b3edba800857830b48668599c.tar.gz
Linting: Fix linting errors.
-rw-r--r--qc_app/jobs.py1
-rw-r--r--qc_app/parse.py10
-rw-r--r--scripts/insert_data.py4
-rw-r--r--scripts/worker.py1
-rw-r--r--tests/qc/test_cells_average.py2
-rw-r--r--tests/qc/test_cells_standard_error.py2
-rw-r--r--wsgi.py1
7 files changed, 14 insertions, 7 deletions
diff --git a/qc_app/jobs.py b/qc_app/jobs.py
index 5f351d4..10ba832 100644
--- a/qc_app/jobs.py
+++ b/qc_app/jobs.py
@@ -7,7 +7,6 @@ from uuid import uuid4
from datetime import timedelta
from redis import Redis
-from flask import current_app as app
def error_filename(job_id, error_dir):
"Compute the path of the file where errors will be dumped."
diff --git a/qc_app/parse.py b/qc_app/parse.py
index 70ef551..ceb8fcf 100644
--- a/qc_app/parse.py
+++ b/qc_app/parse.py
@@ -10,8 +10,14 @@ from quality_control.errors import InvalidValue, DuplicateHeading
from . import jobs
parsebp = Blueprint("parse", __name__)
-isinvalidvalue = lambda item: isinstance(item, InvalidValue)
-isduplicateheading = lambda item: isinstance(item, DuplicateHeading)
+
+def isinvalidvalue(item):
+ """Check whether item is of type InvalidValue"""
+ return isinstance(item, InvalidValue)
+
+def isduplicateheading(item):
+ """Check whether item is of type DuplicateHeading"""
+ return isinstance(item, DuplicateHeading)
@parsebp.route("/parse", methods=["GET"])
def parse():
diff --git a/scripts/insert_data.py b/scripts/insert_data.py
index e1cc29b..c5879ed 100644
--- a/scripts/insert_data.py
+++ b/scripts/insert_data.py
@@ -153,13 +153,13 @@ def __xref_params__(dbconn: mdb.Connection, means: list[dict]) -> dict:
"ProbeSetId": ids[str(mean["ProbeSetId"])]
} for mean in means)
-def insert_means(
+def insert_means(# pylint: disable=[too-many-locals, too-many-arguments]
filepath: str, speciesid: int, platform_id: int, datasetid: int,
dbconn: mdb.Connection, rconn: Redis) -> int: # pylint: disable=[unused-argument]
"Insert the means/averages data into the database"
headings = read_file_headings(filepath)
strains = strains_info(dbconn, headings[1:], speciesid)
- check_strains(headings[1:], strains),
+ check_strains(headings[1:], strains)
probeset_query = (
"INSERT INTO ProbeSet(ChipId, Name) "
"VALUES (%(ChipId)s, %(Name)s) ")
diff --git a/scripts/worker.py b/scripts/worker.py
index 391f522..13556df 100644
--- a/scripts/worker.py
+++ b/scripts/worker.py
@@ -35,6 +35,7 @@ def update_stdout_stderr(rconn, job_id, bytes_read, stream: str):
rconn.hset(name=job_id, key=stream, value=new_contents)
def update_status(rconn, job_id, status):
+ """Update status of job in redis."""
rconn.hset(name=job_id, key="status", value=status)
def run_job(job, rconn):
diff --git a/tests/qc/test_cells_average.py b/tests/qc/test_cells_average.py
index c2b382a..68fd4ec 100644
--- a/tests/qc/test_cells_average.py
+++ b/tests/qc/test_cells_average.py
@@ -1,4 +1,4 @@
-import re
+"""Test average values."""
from random import randint
from hypothesis import given
from hypothesis import strategies as st
diff --git a/tests/qc/test_cells_standard_error.py b/tests/qc/test_cells_standard_error.py
index aa25aa8..90c13cf 100644
--- a/tests/qc/test_cells_standard_error.py
+++ b/tests/qc/test_cells_standard_error.py
@@ -1,4 +1,4 @@
-import re
+"""Test standard error values."""
from random import randint
diff --git a/wsgi.py b/wsgi.py
index 40c4473..0f246aa 100644
--- a/wsgi.py
+++ b/wsgi.py
@@ -4,6 +4,7 @@ from qc_app import create_app, instance_path
from qc_app.check_connections import check_db, check_redis
def check_and_build_app():
+ """Setup the application for running."""
# Setup the app
appl = create_app(instance_path())