From 7fa17a43cf4a5d5c2fde75e47d0857c4b4cfd8fc Mon Sep 17 00:00:00 2001 From: Sam Bessey Date: Wed, 15 Feb 2023 14:24:48 -0500 Subject: [PATCH] fix mypy typing errors --- titan/features/high_risk.py | 2 +- titan/model.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/titan/features/high_risk.py b/titan/features/high_risk.py index 824b052b..8ce14054 100644 --- a/titan/features/high_risk.py +++ b/titan/features/high_risk.py @@ -128,7 +128,7 @@ def set_stats(self, stats: Dict[str, int], time: int): # ============== HELPER METHODS ================ def become_high_risk( - self, pop: "population.Population", time: int, duration: int = None + self, pop: "population.Population", time: int, duration: Optional[int] = None ): """ Mark an agent as high risk and assign a duration to their high risk period diff --git a/titan/model.py b/titan/model.py index 57aa2c0d..e70ad942 100644 --- a/titan/model.py +++ b/titan/model.py @@ -192,9 +192,9 @@ def step(self, outdir: str): " STARTING HIV count:{} Total Incarcerated:{} HR+:{} " "PrEP:{}".format( len(exposures.HIV.agents), - sum([1 for a in self.pop.all_agents if a.incar.active]), # type: ignore[attr-defined] - sum([1 for a in self.pop.all_agents if a.high_risk.active]), # type: ignore[attr-defined] - sum([1 for a in self.pop.all_agents if a.prep.active]), # type: ignore[attr-defined] + sum([1 for a in self.pop.all_agents if a.incar.active]), # type: ignore[misc, attr-defined] + sum([1 for a in self.pop.all_agents if a.high_risk.active]), # type: ignore[misc, attr-defined] + sum([1 for a in self.pop.all_agents if a.prep.active]), # type: ignore[misc, attr-defined] ) )