From a35fce27875d9db80dce1976b6f8ee8c00ecfe0a Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Mon, 21 Feb 2022 16:23:06 +0300 Subject: Fix a myriad of linter issues * Use `with` in place of plain `open` * Use f-strings in place of `str.format()` * Remove string interpolation from queries - provide data as query parameters * other minor fixes --- gn3/api/correlation.py | 3 ++- gn3/api/heatmaps.py | 3 +-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'gn3/api') diff --git a/gn3/api/correlation.py b/gn3/api/correlation.py index cbe01d8..00b3ad5 100644 --- a/gn3/api/correlation.py +++ b/gn3/api/correlation.py @@ -1,9 +1,10 @@ """Endpoints for running correlations""" import json +from functools import reduce + from flask import jsonify from flask import Blueprint from flask import request -from functools import reduce from flask import make_response from gn3.computations.correlations import compute_all_sample_correlation diff --git a/gn3/api/heatmaps.py b/gn3/api/heatmaps.py index 633a061..b2511c3 100644 --- a/gn3/api/heatmaps.py +++ b/gn3/api/heatmaps.py @@ -27,8 +27,7 @@ def clustered_heatmaps(): conn, _cursor = database_connector() def parse_trait_fullname(trait): name_parts = trait.split(":") - return "{dataset_name}::{trait_name}".format( - dataset_name=name_parts[1], trait_name=name_parts[0]) + return f"{name_parts[1]}::{name_parts[0]}" traits_fullnames = [parse_trait_fullname(trait) for trait in traits_names] with io.StringIO() as io_str: -- cgit v1.2.3