From e5f63e08ea19528aab4df17192e58a4ae607415e Mon Sep 17 00:00:00 2001 From: Laura Boenchen Date: Tue, 14 Jan 2025 17:09:24 +0100 Subject: [PATCH 1/3] fix linting issues --- medmodels/medrecord/_overview.py | 2 +- medmodels/medrecord/medrecord.py | 13 ++++--------- .../evaluate_compare/compare.pyi | 11 ----------- .../evaluate_compare/evaluate.pyi | 2 -- 4 files changed, 5 insertions(+), 23 deletions(-) diff --git a/medmodels/medrecord/_overview.py b/medmodels/medrecord/_overview.py index 33b5701..0efb9b9 100644 --- a/medmodels/medrecord/_overview.py +++ b/medmodels/medrecord/_overview.py @@ -9,7 +9,7 @@ import polars as pl from medmodels.medrecord.schema import AttributesSchema, AttributeType -from medmodels.medrecord.types import AttributeSummary, Attributes, EdgeIndex, NodeIndex +from medmodels.medrecord.types import Attributes, AttributeSummary, EdgeIndex, NodeIndex if TYPE_CHECKING: import sys diff --git a/medmodels/medrecord/medrecord.py b/medmodels/medrecord/medrecord.py index 8437528..14567ca 100644 --- a/medmodels/medrecord/medrecord.py +++ b/medmodels/medrecord/medrecord.py @@ -103,7 +103,7 @@ def __init__( """Initializes the OverviewTable class. Args: - data (Dict[Group, AttributeSummary]): Dictionary containing attribute info for edges/nodes. + data (Dict[Group, AttributeSummary]): Dictionary containing attribute info. group_header (str): Header for group column, i.e. 'Group Nodes'. decimal (int): Decimal point to round the float values to. """ @@ -1302,14 +1302,9 @@ def _describe_group_nodes( ) -> Dict[Group, AttributeSummary]: """Creates a summary of group nodes and their attributes. - Returns: - <<<<<<< HEAD - Dict[Group, AttributeSummary]: Dictionary with all nodes in medrecord groups - and their attributes. - ======= - pl.DataFrame: Dataframe with all nodes in medrecord groups and their - attributes. - >>>>>>> main + Returns: + Dict[Group, AttributeSummary]: Dictionary with all nodes in medrecord groups + and their attributes. """ nodes_info = {} grouped_nodes = [] diff --git a/medmodels/statistic_evaluations/evaluate_compare/compare.pyi b/medmodels/statistic_evaluations/evaluate_compare/compare.pyi index 0b36ae2..e059e40 100644 --- a/medmodels/statistic_evaluations/evaluate_compare/compare.pyi +++ b/medmodels/statistic_evaluations/evaluate_compare/compare.pyi @@ -1,5 +1,3 @@ -from __future__ import annotations - from typing import Dict, List, Tuple, TypedDict from medmodels.medrecord.types import ( @@ -12,28 +10,19 @@ from medmodels.medrecord.types import ( from medmodels.statistic_evaluations.evaluate_compare.evaluate import CohortEvaluator class CohortSummary(TypedDict): - """Dictionary for the cohort summary.""" - attribute_info: Dict[Group, AttributeSummary] top_k_concepts: Dict[Group, List[NodeIndex]] class DistanceSummary(TypedDict): - """Dictonary for the Jensen-Shannon-Divergence and normalized distance between - distributions.""" - js_divergence: float distance: float class ComparerSummary(TypedDict): - """Dictionary for comparing results.""" - attribute_tests: Dict[MedRecordAttribute, List[TestSummary]] concepts_tests: Dict[Group, List[TestSummary]] concepts_distance: Dict[Group, DistanceSummary] class TestSummary(TypedDict): - """Dictionary for hypothesis test results.""" - test: str Hypothesis: str not_reject: bool diff --git a/medmodels/statistic_evaluations/evaluate_compare/evaluate.pyi b/medmodels/statistic_evaluations/evaluate_compare/evaluate.pyi index c45247c..02d920f 100644 --- a/medmodels/statistic_evaluations/evaluate_compare/evaluate.pyi +++ b/medmodels/statistic_evaluations/evaluate_compare/evaluate.pyi @@ -1,5 +1,3 @@ -from __future__ import annotations - from typing import Dict, List, Optional, Tuple, Union from medmodels.medrecord.medrecord import MedRecord From 5b23761aed95af1a460ea5c372f00bc77a32425e Mon Sep 17 00:00:00 2001 From: Laura Boenchen <129750059+LauraBoenchenLB@users.noreply.github.com> Date: Fri, 17 Jan 2025 11:40:08 +0100 Subject: [PATCH 2/3] fix PR comments Co-authored-by: Martin Iniguez <60970451+MarIniOnz@users.noreply.github.com> --- medmodels/medrecord/medrecord.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/medmodels/medrecord/medrecord.py b/medmodels/medrecord/medrecord.py index 14567ca..867bfc8 100644 --- a/medmodels/medrecord/medrecord.py +++ b/medmodels/medrecord/medrecord.py @@ -103,7 +103,7 @@ def __init__( """Initializes the OverviewTable class. Args: - data (Dict[Group, AttributeSummary]): Dictionary containing attribute info. + data (Dict[Group, AttributeSummary]): Dictionary containing attribute information. group_header (str): Header for group column, i.e. 'Group Nodes'. decimal (int): Decimal point to round the float values to. """ From 452c6eb5814e2b06bc698a05b19b73835fda1532 Mon Sep 17 00:00:00 2001 From: Laura Boenchen Date: Fri, 17 Jan 2025 12:18:53 +0100 Subject: [PATCH 3/3] fix linting issues --- medmodels/medrecord/medrecord.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/medmodels/medrecord/medrecord.py b/medmodels/medrecord/medrecord.py index 867bfc8..65a488d 100644 --- a/medmodels/medrecord/medrecord.py +++ b/medmodels/medrecord/medrecord.py @@ -103,7 +103,8 @@ def __init__( """Initializes the OverviewTable class. Args: - data (Dict[Group, AttributeSummary]): Dictionary containing attribute information. + data (Dict[Group, AttributeSummary]): Dictionary containing attribute + information. group_header (str): Header for group column, i.e. 'Group Nodes'. decimal (int): Decimal point to round the float values to. """