aboutsummaryrefslogtreecommitdiff
path: root/gn3/api
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2022-03-11 11:51:02 +0300
committerFrederick Muriuki Muriithi2022-03-11 11:51:02 +0300
commit9691e225724e041997c74f8665dcbfa12bb1c579 (patch)
tree271d99dbf6d72161e343ddf8765f9543fe752e37 /gn3/api
parenta7696cc668e00215e1d5af2425765451811bca9d (diff)
downloadgenenetwork3-9691e225724e041997c74f8665dcbfa12bb1c579.tar.gz
Fix some linting issues
Diffstat (limited to 'gn3/api')
-rw-r--r--gn3/api/async_commands.py6
-rw-r--r--gn3/api/correlation.py6
2 files changed, 2 insertions, 10 deletions
diff --git a/gn3/api/async_commands.py b/gn3/api/async_commands.py
index 81c3c44..c0cf4bb 100644
--- a/gn3/api/async_commands.py
+++ b/gn3/api/async_commands.py
@@ -1,6 +1,4 @@
"""Endpoints and functions concerning commands run in external processes."""
-import json
-
import redis
from flask import jsonify, Blueprint
@@ -8,11 +6,11 @@ async_commands = Blueprint("async_commands", __name__)
@async_commands.route("/state/<command_id>")
def command_state(command_id):
+ """Respond with the current state of command identified by `command_id`."""
with redis.Redis(decode_responses=True) as rconn:
state = rconn.hgetall(name=command_id)
if not state:
return jsonify(
status=404,
error="The command id provided does not exist.")
- state = {key: val for key,val in state.items()}
- return jsonify(state)
+ return jsonify(dict(state.items()))
diff --git a/gn3/api/correlation.py b/gn3/api/correlation.py
index 67897e8..7eb7cd6 100644
--- a/gn3/api/correlation.py
+++ b/gn3/api/correlation.py
@@ -1,6 +1,5 @@
"""Endpoints for running correlations"""
import sys
-import json
from functools import reduce
import redis
@@ -17,7 +16,6 @@ from gn3.computations.correlations import map_shared_keys_to_values
from gn3.computations.correlations import compute_tissue_correlation
from gn3.computations.correlations import compute_all_lit_correlation
from gn3.computations.correlations import compute_all_sample_correlation
-from gn3.computations.partial_correlations import partial_correlations_entry
correlation = Blueprint("correlation", __name__)
@@ -132,7 +130,3 @@ def partial_correlation():
int(args.get("criteria", 500))),
job_queue=current_app.config.get("REDIS_JOB_QUEUE"),
env = {"PYTHONPATH": ":".join(sys.path), "SQL_URI": SQL_URI})})
-
-@correlation.route("/partial/<job_id>", methods=["GET"])
-def partial_correlation_results():
- raise Exception("Not implemented!!")