From 8e0fcfa78fcdb5bdd5b49e2b1ac918ae9cc0fc53 Mon Sep 17 00:00:00 2001 From: zsloan Date: Fri, 25 Feb 2022 21:03:15 +0000 Subject: Fix issue where 0's were treated as False for the primary trait in correlations In the original version of the if statement* I believe it was interpreted as "if a_val and (b_val is not None)". This caused values of 0 for a_val (the primary trait's values) to be evaluated as False. I changed it to compare both a_val and b_val to None. This seems to have fixed the issue. * if (a_val and b_val is not None) --- gn3/computations/correlations.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gn3') diff --git a/gn3/computations/correlations.py b/gn3/computations/correlations.py index e30d497..a0da2c4 100644 --- a/gn3/computations/correlations.py +++ b/gn3/computations/correlations.py @@ -47,7 +47,7 @@ def normalize_values(a_values: List, b_values: List) -> Generator: """ for a_val, b_val in zip(a_values, b_values): - if (a_val and b_val is not None): + if (a_val is not None) and (b_val is not None): yield a_val, b_val -- cgit v1.2.3