From bebf05c5975c706be05053d362ababd2419250be Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Thu, 23 Dec 2021 05:09:14 +0300 Subject: Rework database functions to fetch multiple items Issue: https://github.com/genenetwork/gn-gemtext-threads/blob/main/topics/gn1-migration-to-gn2/partial-correlations.gmi * In an attempt to optimise the performance of the partial correlations feature, this commit reworks some database access functions to fetch multiple items from the database, per query, unlike their original forms which would fetch a single item per query. This reduces queries to the database, and should hopefully improve the responsiveness of the partial correlations feature. --- gn3/computations/partial_correlations.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gn3/computations') diff --git a/gn3/computations/partial_correlations.py b/gn3/computations/partial_correlations.py index 984c15a..0d4394b 100644 --- a/gn3/computations/partial_correlations.py +++ b/gn3/computations/partial_correlations.py @@ -539,7 +539,7 @@ def trait_for_output(trait): pair just to indicate it does not exist. """ trait = { - "trait_type": trait["trait_type"], + "trait_type": trait["db"]["dataset_type"], "dataset_name": trait["db"]["dataset_name"], "dataset_type": trait["db"]["dataset_type"], "group": trait["db"]["group"], -- cgit v1.2.3