Skip to content
Snippets Groups Projects
Commit df8d1a68 authored by Matthew K Defenderfer's avatar Matthew K Defenderfer
Browse files

Fix logic for dealing with naked integers in prep_age_distribution

parent c539f04f
No related branches found
No related tags found
2 merge requests!76Patch v0.5.1,!71Fix logic for dealing with naked integers in prep_age_distribution
......@@ -70,9 +70,11 @@ def prep_age_distribution(
age_breakpoints: int | List[int],
time_unit: Literal['D','W']
) -> Tuple[List[np.datetime64],List[str]]:
if any([b < 0 for b in age_breakpoints]):
raise ValueError("Timestamp cannot be newer than the current date time")
age_breakpoints = list(set(age_breakpoints))
if not isinstance(age_breakpoints,list):
age_breakpoints = [age_breakpoints]
else:
age_breakpoints = list(set(age_breakpoints))
age_breakpoints.sort()
age_breakpoints = [t for t in age_breakpoints if t > 0]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment