aboutsummaryrefslogtreecommitdiff
path: root/gn3/computations
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2021-11-19 10:56:35 +0300
committerFrederick Muriuki Muriithi2021-11-19 10:56:35 +0300
commit08c81b8892060353bb7fb15555875f03bbdcb46e (patch)
treeef545062885d08a3425e59e52164b6822cb93b9a /gn3/computations
parent6367350202a4a7eb9c6551d01cc1b4543d2529f0 (diff)
downloadgenenetwork3-08c81b8892060353bb7fb15555875f03bbdcb46e.tar.gz
Avoid rounding: compare floats approximately
Notes: https://github.com/genenetwork/genenetwork3/pull/56#issuecomment-973798918 * As mentioned in the notes, rather than rounding to an arbitrary number of decimal places, it is a much better practice to use approximate comparisons of floats for the tests.
Diffstat (limited to 'gn3/computations')
-rw-r--r--gn3/computations/partial_correlations.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/gn3/computations/partial_correlations.py b/gn3/computations/partial_correlations.py
index ee47290..4f45159 100644
--- a/gn3/computations/partial_correlations.py
+++ b/gn3/computations/partial_correlations.py
@@ -156,7 +156,7 @@ def tissue_correlation(
"Method must be one of: {}".format(",".join(method_fns.keys())))
corr, pvalue = method_fns[method](primary_trait_values, target_trait_values)
- return (round(corr, 10), round(pvalue, 10))
+ return (corr, pvalue)
def batch_computed_tissue_correlation(
primary_trait_values: Tuple[float, ...], target_traits_dict: dict,