From 05013c13710eccadb69746bf186eb672c2af69c4 Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Wed, 22 Oct 2025 13:27:54 -0500 Subject: Fetch configs from app setting and pass them down Fix the code to avoid using global variables holding configuration variables to avoid the failures caused by action-at-a-distance effects due to change of a value elsewhere. This way, all code consistently receives the same configuration values passed on from callers. We pass on the following configuration settings: * TMPDIR * SQL_URI * TEXTDIR --- gn3/computations/ctl.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'gn3/computations/ctl.py') diff --git a/gn3/computations/ctl.py b/gn3/computations/ctl.py index f881410..5c004ea 100644 --- a/gn3/computations/ctl.py +++ b/gn3/computations/ctl.py @@ -6,13 +6,11 @@ from gn3.computations.wgcna import dump_wgcna_data from gn3.computations.wgcna import compose_wgcna_cmd from gn3.computations.wgcna import process_image -from gn3.settings import TMPDIR - -def call_ctl_script(data): +def call_ctl_script(data, tmpdir): """function to call ctl script""" - data["imgDir"] = TMPDIR - temp_file_name = dump_wgcna_data(data) + data["imgDir"] = tmpdir + temp_file_name = dump_wgcna_data(data, tmpdir) cmd = compose_wgcna_cmd("ctl_analysis.R", temp_file_name) cmd_results = run_cmd(cmd) -- cgit 1.4.1