From c40038be2e27a13db37564d6ec891292a556e45c Mon Sep 17 00:00:00 2001 From: svittoz Date: Mon, 12 Feb 2024 13:25:52 +0000 Subject: [PATCH] coverage --- eds_scikit/biology/utils/process_concepts.py | 5 ++++- tests/test_biology.py | 8 ++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/eds_scikit/biology/utils/process_concepts.py b/eds_scikit/biology/utils/process_concepts.py index b9093078..03cf1b59 100644 --- a/eds_scikit/biology/utils/process_concepts.py +++ b/eds_scikit/biology/utils/process_concepts.py @@ -7,6 +7,7 @@ from eds_scikit import datasets from eds_scikit.biology.utils.process_units import Units from eds_scikit.io import settings +from eds_scikit.utils.typing import DataFrame default_standard_terminologies = settings.standard_terminologies default_source_terminologies = settings.source_terminologies @@ -74,7 +75,9 @@ def remove_concept_codes( logger.error("concept_codes must be string or list") raise TypeError - def get_concept_codes_table(self, terminologies=None, relationship_table=None): + def get_concept_codes_table( + self, terminologies: str = None, relationship_table: DataFrame = None + ): if not terminologies: terminologies = self.concept_codes.keys() diff --git a/tests/test_biology.py b/tests/test_biology.py index e8a19c46..438f5b7d 100644 --- a/tests/test_biology.py +++ b/tests/test_biology.py @@ -70,6 +70,14 @@ def concepts_sets(data): assert set(concept_set.concept_codes) == set(concepts_sets[0].concept_codes) + relationship_table = prepare_biology_relationship_table( + data, [concept_set], get_all_terminologies=True + ) + concept_set.get_concept_codes_table(relationship_table=relationship_table) + + concept_set.add_target_unit("g") + concept_set.add_conversion("g", "mol", 180) + return concepts_sets