Skip to content

Commit

Permalink
fixing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
svittoz committed Feb 8, 2024
1 parent c415802 commit 94558a4
Show file tree
Hide file tree
Showing 6 changed files with 96 additions and 89 deletions.
6 changes: 4 additions & 2 deletions eds_scikit/biology/cleaning/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def bioclean(
concepts_sets = fetch_all_concepts_set()

measurements = prepare_measurement_table(
data, start_date, end_date, concepts_sets, convert_units
data, start_date, end_date, concepts_sets, False, convert_units
)
# Filter Measurement.
if studied_cohort:
Expand All @@ -70,4 +70,6 @@ def bioclean(
)
# Plot values
value_column = "value_as_number_normalized" if convert_units else "value_as_number"
plot_biology_summary(measurements, value_column)
unit_column = "unit_source_value_normalized" if convert_units else "unit_source_value"

plot_biology_summary(measurements, value_column, unit_column)
1 change: 0 additions & 1 deletion eds_scikit/biology/utils/prepare_measurement.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ def prepare_measurement_table(
measurement["value_as_number_normalized"] = (
measurement["value_as_number"] * measurement["factor"]
)

if is_koalas(measurement):
measurement.cache()
logger.info("Done. Once computed, measurement will be cached.")
Expand Down
8 changes: 6 additions & 2 deletions eds_scikit/biology/utils/process_concepts.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,18 @@ def add_concept_codes(
raise TypeError
if isinstance(concept_codes, str):
concept_codes = [concept_codes]
if isinstance(concept_codes, list):
elif isinstance(concept_codes, list):
for concept_code in concept_codes:
if not(isinstance(concept_code, str)):
logger.error("concept_codes must be string or list of string")
raise TypeError
if not (terminology in self.concept_codes.keys()):
self.concept_codes[terminology] = []
for concept_code in concept_codes:
if concept_code not in self.concept_codes[terminology]:
self.concept_codes[terminology].append(concept_code)
else:
logger.error("concept_codes must be string or list")
logger.error("concept_codes must be string or list of string")
raise TypeError

def remove_concept_codes(
Expand Down
Loading

0 comments on commit 94558a4

Please sign in to comment.