From 14f70b34235dbf43d68ad72ea74a2020af890072 Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Tue, 14 Dec 2021 13:46:40 +0300 Subject: mypy: ignore some imports and errors * Ignore some missing library stubs * Ignore some typing errors * Fix obvious typing errors --- gn3/computations/partial_correlations.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'gn3/computations') diff --git a/gn3/computations/partial_correlations.py b/gn3/computations/partial_correlations.py index 95eb5e9..91e953a 100644 --- a/gn3/computations/partial_correlations.py +++ b/gn3/computations/partial_correlations.py @@ -259,8 +259,9 @@ def partial_correlations_fast(# pylint: disable=[R0913, R0914] ## `correlation_type` parameter return len(all_correlations), tuple( corr + ( - (fetched_correlations[corr[0]],) if correlation_type == "literature" - else fetched_correlations[corr[0]][0:2]) + (fetched_correlations[corr[0]],) # type: ignore[index] + if correlation_type == "literature" + else fetched_correlations[corr[0]][0:2]) # type: ignore[index] for idx, corr in enumerate(all_correlations)) def build_data_frame( @@ -372,7 +373,7 @@ def partial_correlations_normal(# pylint: disable=R0913 return tuple(item) + (trait_database[1], trait_database[2]) return item - target_trait_names, target_trait_vals = reduce( + target_trait_names, target_trait_vals = reduce(# type: ignore[var-annotated] lambda acc, item: (acc[0]+(item[0],), acc[1]+(item[data_start_pos:],)), trait_database, (tuple(), tuple())) @@ -425,7 +426,7 @@ def partial_corrs(# pylint: disable=[R0913] data_start_pos, dataset, method) def literature_correlation_by_list( - conn: Any, species: str, trait_list: Tuple[dict]) -> Tuple[dict]: + conn: Any, species: str, trait_list: Tuple[dict]) -> Tuple[dict, ...]: """ This is a migration of the `web.webqtl.correlation.CorrelationPage.getLiteratureCorrelationByList` -- cgit v1.2.3