diff options
| author | Frederick Muriuki Muriithi | 2025-10-22 13:27:54 -0500 |
|---|---|---|
| committer | Frederick Muriuki Muriithi | 2025-10-22 13:27:54 -0500 |
| commit | 05013c13710eccadb69746bf186eb672c2af69c4 (patch) | |
| tree | 71a706fd30bf0d535a0fab737bb0e42a1667e60b /gn3/computations/ctl.py | |
| parent | 977efbb54da284fb3e8476f200206d00cb8e64cd (diff) | |
| download | genenetwork3-05013c13710eccadb69746bf186eb672c2af69c4.tar.gz | |
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
Diffstat (limited to 'gn3/computations/ctl.py')
| -rw-r--r-- | gn3/computations/ctl.py | 8 |
1 files changed, 3 insertions, 5 deletions
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) |
