Skip to content

Commit

Permalink
Fixed reporting date filtering
Browse files Browse the repository at this point in the history
  • Loading branch information
thanasibakis committed Aug 15, 2024
1 parent d7e02f3 commit 53d20b9
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions linmod/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,9 +206,8 @@
# Drop samples collected outside the horizon
horizon_lower_date <= pl.col("date"),
pl.col("date") <= horizon_upper_date,
# Drop samples reported outside the horizon
horizon_lower_date <= pl.col("date_submitted"),
pl.col("date_submitted") <= horizon_upper_date,
# Drop samples claiming to be reported before being collected
pl.col("date") <= pl.col("date_submitted"),
# Drop samples not from humans in the included US divisions
pl.col("division").is_in(config["data"]["included_divisions"]),
country="USA",
Expand Down Expand Up @@ -236,10 +235,7 @@
print_message("Exporting modeling dataset...", end="")

model_df = (
full_df.filter(
pl.col("date") <= forecast_date,
pl.col("date_submitted") <= forecast_date,
)
full_df.filter(pl.col("date_submitted") <= forecast_date)
.group_by("lineage", "date", "division")
.agg(pl.len().alias("count"))
.with_columns(
Expand Down

0 comments on commit 53d20b9

Please sign in to comment.