Skip to content

Commit

Permalink
code review suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
sbidari committed Feb 13, 2025
1 parent 6cb725e commit 6582005
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion pipelines/build_pyrenew_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def build_model_from_dir(
"lab_site_index": pl.Int64,
"log_genomes_copies_per_ml": pl.Float64,
"log_lod": pl.Float64,
"below_lod": pl.Int64,
"below_lod": pl.Boolean,
},
)

Expand Down
32 changes: 16 additions & 16 deletions pipelines/prep_ww_data.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import datetime
from pathlib import Path

import polars as pl

Expand Down Expand Up @@ -178,16 +179,22 @@ def validate_ww_conc_data(
if ww_data.is_empty():
raise ValueError("Input DataFrame 'ww_data' is empty.")

required_cols = [
conc_col_name,
lod_col_name,
date_col_name,
wwtp_col_name,
wwtp_pop_name,
lab_col_name,
]

assert all(
col in ww_data.columns for col in required_cols
), "One or more required column(s) missing"

check_missing_values(
ww_data,
[
conc_col_name,
lod_col_name,
date_col_name,
wwtp_col_name,
wwtp_pop_name,
lab_col_name,
],
required_cols,
)

assert ww_data[conc_col_name].dtype.is_float()
Expand Down Expand Up @@ -228,13 +235,6 @@ def preprocess_ww_data(
flag concentration data below the level of detection.
"""
assert (
conc_col_name in ww_data.columns
), f"Column '{conc_col_name}' is missing in the input data."
assert (
lod_col_name in ww_data.columns
), f"Column '{lod_col_name}' is missing in the input data."

validate_ww_conc_data(
ww_data,
conc_col_name=conc_col_name,
Expand Down Expand Up @@ -292,7 +292,7 @@ def preprocess_ww_data(


def get_nwss_data(
ww_data_path,
ww_data_path: Path,
start_date: datetime.date,
state_abb: str,
) -> pl.DataFrame:
Expand Down

0 comments on commit 6582005

Please sign in to comment.