aboutsummaryrefslogtreecommitdiff
path: root/gn3/api
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2023-10-06 10:42:05 +0300
committerFrederick Muriuki Muriithi2023-10-06 10:42:05 +0300
commitd96c1b8806780174c737b186fb5757dcd2fccb66 (patch)
tree4ea05f331777ce954dac136232fbeda6380ad4c1 /gn3/api
parent6e628e075f53ced7a73fd1ba774d782d52e90df6 (diff)
downloadgenenetwork3-d96c1b8806780174c737b186fb5757dcd2fccb66.tar.gz
Pass in configs/settings as function arguments
To avoid reliance of `flask.current_app.config` or on `gn3.settings` modules globally, this commit passes in the appropriate configurations as arguments to the relevant functions.
Diffstat (limited to 'gn3/api')
-rw-r--r--gn3/api/heatmaps.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/gn3/api/heatmaps.py b/gn3/api/heatmaps.py
index 26c165f..1b04a95 100644
--- a/gn3/api/heatmaps.py
+++ b/gn3/api/heatmaps.py
@@ -31,7 +31,11 @@ def clustered_heatmaps():
traits_fullnames = [parse_trait_fullname(trait) for trait in traits_names]
with io.StringIO() as io_str:
- figure = build_heatmap(traits_fullnames, conn, vertical=vertical)
+ figure = build_heatmap(conn,
+ traits_fullnames,
+ current_app.config["GENOTYPE_FILES"],
+ vertical=vertical,
+ current_app.config["TMPDIR"])
figure.write_json(io_str)
fig_json = io_str.getvalue()
return fig_json, 200