From d96c1b8806780174c737b186fb5757dcd2fccb66 Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Fri, 6 Oct 2023 10:42:05 +0300 Subject: 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. --- gn3/api/heatmaps.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'gn3/api') 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 -- cgit v1.2.3