Skip to content

Commit

Permalink
tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sprivite committed Nov 19, 2024
1 parent e3cf021 commit cbd072f
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 254 deletions.
107 changes: 0 additions & 107 deletions phenex/phenotypes/continuous_coverage_phenotype.py

This file was deleted.

9 changes: 5 additions & 4 deletions phenex/phenotypes/sex_phenotype.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class SexPhenotype(Phenotype):
def __init__(
self,
name: str = "sex",
allowed_values: List[str] = ["male", "female"],
allowed_values: Optional[List[str]] = None,
domain: str = "PERSON",
):
self.name = name
Expand All @@ -37,7 +37,8 @@ def _execute(self, tables: Dict[str, Table]) -> PhenotypeTable:
person_table = tables[self.domain]
assert is_phenex_person_table(person_table)

sex_filter = CategoricalFilter(column_name="SEX", allowed_values=self.allowed_values)
filtered_table = sex_filter._filter(person_table)
if self.allowed_values is not None:
sex_filter = CategoricalFilter(column_name="SEX", allowed_values=self.allowed_values)
person_table = sex_filter._filter(person_table)

return filtered_table.mutate(VALUE=filtered_table.SEX, EVENT_DATE= ibis.null())
return person_table.mutate(VALUE=person_table.SEX, EVENT_DATE= ibis.null())
2 changes: 1 addition & 1 deletion phenex/test/phenotype_test_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ def df_from_test_info(test_info):
if "date" in col.lower():
schema[col] = datetime.date
elif "value" in col.lower():
schema[col] = float
schema[col] = str if isinstance(df[col].iloc[0], str) else float
elif "boolean" in col.lower():
schema[col] = bool
else:
Expand Down
141 changes: 0 additions & 141 deletions phenex/test/phenotypes/test_continuous_coverage_phenotype.py

This file was deleted.

2 changes: 1 addition & 1 deletion phenex/test/phenotypes/test_sex_phenotype.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def define_input_tables(self):

column_types_person = {}
input_info_person = {
"name": "person",
"name": "PERSON",
"df": df_person,
"column_types": column_types_person,
}
Expand Down

0 comments on commit cbd072f

Please sign in to comment.