Skip to content

Commit

Permalink
Fix max window for specific years
Browse files Browse the repository at this point in the history
  • Loading branch information
luabida committed Dec 19, 2023
1 parent c5c215d commit 6a0b1fc
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/scanner/scanner.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ def __init__(
self.uf = uf
self.verbose = verbose
self.data = self._get_alerta_table()
self.window = int(self.data.SE.max() % 100)

asyncio.run(self._scan_all())

Expand Down Expand Up @@ -260,6 +259,7 @@ async def scan_year(y):
logger.info(f"Scanning year {y}")

dfy = df[df.year == y]
window = int(max([str(x)[-2:] for x in dfy.SE]))
has_transmission = dfy.transmissao.sum() > 3

if not has_transmission:
Expand All @@ -273,9 +273,9 @@ async def scan_year(y):
return

out, curve = otim(
dfy[["casos", "casos_cum"]].iloc[0 : self.window], # NOQA E203
dfy[["casos", "casos_cum"]].iloc[0: window], # NOQA E203
0,
self.window,
window,
)

self._save_results(geocode, y, out, curve)
Expand Down

0 comments on commit 6a0b1fc

Please sign in to comment.