aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2022-02-03 03:30:52 +0300
committerBonfaceKilz2022-02-08 10:12:27 +0300
commit5ca7e792083f25b487890f9f38ae57bd3f9c29c4 (patch)
treea2058667d892c7d0acc34e77d9b2250d9e180cb2
parent834821b086d6a963b60bddb4bf41aee94af5f0db (diff)
downloadgenenetwork3-5ca7e792083f25b487890f9f38ae57bd3f9c29c4.tar.gz
Remove unnecessary computation
In Python3 when slicing, seq[:min(some_val, len(seq))] == seq[:some_val] because Python3 will just return a copy of the entire sequence if `some_val` happens to be larger/greater than the length of the sequence. This commit removes the unnecessary call to `min()`
-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 9bad12a..157024b 100644
--- a/gn3/computations/partial_correlations.py
+++ b/gn3/computations/partial_correlations.py
@@ -753,7 +753,7 @@ def partial_correlations_entry(# pylint: disable=[R0913, R0914, R0911]
selected_results = sorted(
all_correlations,
- key=__make_sorter__(method))[:min(criteria, len(all_correlations))]
+ key=__make_sorter__(method))[:criteria]
traits_list_corr_info = {
f"{target_dataset['dataset_name']}::{item[0]}": {
"noverlap": item[1],