From 164da23e29354a74e30db7348d93860f3d5b4ea1 Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Fri, 6 Oct 2023 11:34:54 +0300 Subject: Get `CORRELATION_COMMAND` from current_app not `gn3.settings` The default settings in `gn3.settings` are meant to be overridden thus the code should not be importing the setting from there, rather, the code should get its configurations settings from `flask.current_app.config`. --- gn3/computations/rust_correlation.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gn3/computations/rust_correlation.py b/gn3/computations/rust_correlation.py index 546da0e..1ae26b8 100644 --- a/gn3/computations/rust_correlation.py +++ b/gn3/computations/rust_correlation.py @@ -3,15 +3,15 @@ https://github.com/Alexanderlacuna/correlation_rust """ - import subprocess import json import csv import os +from flask import current_app + from gn3.computations.qtlreaper import create_output_directory from gn3.chancy import random_string -from gn3.settings import CORRELATION_COMMAND from gn3.settings import TMPDIR @@ -54,6 +54,7 @@ def run_correlation( """entry function to call rust correlation""" # pylint: disable=too-many-arguments + CORRELATION_COMMAND = current_app.config["CORRELATION_COMMAND"] # make arg? (tmp_dir, tmp_file) = generate_input_files(dataset) (output_file, json_file) = generate_json_file( tmp_dir=tmp_dir, tmp_file=tmp_file, method=method, delimiter=delimiter, -- cgit v1.2.3