aboutsummaryrefslogtreecommitdiff
path: root/gn3/computations
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2022-07-29 03:39:32 +0300
committerFrederick Muriuki Muriithi2022-07-29 03:53:49 +0300
commite3622ac213ef6e1be8a38959f7c6ee082c112c95 (patch)
treeb8416a7fbceb8e228c253db6dace099702e4fd4f /gn3/computations
parent921b5fe752e4a947595a86572592d5bbdeb16ead (diff)
downloadgenenetwork3-e3622ac213ef6e1be8a38959f7c6ee082c112c95.tar.gz
Fix failing tests
* gn3/computations/correlations.py: rename function * mypy.ini: deactivate mypy error about missing imports * tests/integration/test_correlation.py: mock correct function * tests/unit/computations/test_correlation.py: test correct function
Diffstat (limited to 'gn3/computations')
-rw-r--r--gn3/computations/correlations.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/gn3/computations/correlations.py b/gn3/computations/correlations.py
index ea1a862..5a9ce62 100644
--- a/gn3/computations/correlations.py
+++ b/gn3/computations/correlations.py
@@ -162,7 +162,8 @@ def fast_compute_all_sample_correlation(this_trait,
corr_results,
key=lambda trait_name: -abs(list(trait_name.values())[0]["corr_coefficient"]))
-def __corr_compute__(trait_samples, target_trait, corr_method):
+def compute_one_sample_correlation(trait_samples, target_trait, corr_method):
+ """Compute sample correlation against a single trait."""
trait_name = target_trait.get("trait_id")
target_trait_data = target_trait["trait_sample_data"]
try:
@@ -200,7 +201,7 @@ def compute_all_sample_correlation(this_trait,
(
corr for corr in
pool.starmap(
- __corr_compute__,
+ compute_one_sample_correlation,
((this_trait_samples, trait, corr_method) for trait in target_dataset))
if corr is not None),
key=lambda trait_name: -abs(