Skip to content

Commit

Permalink
updated the validation
Browse files Browse the repository at this point in the history
  • Loading branch information
manandraj20 committed Nov 1, 2024
1 parent 2e9bde4 commit ae87f9a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/DP_epidemiology/contact_matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ def validate_input_data(df, age_groups, consumption_distribution, start_date: da
# check start date is not beyong the latest date and end date is not before the starting date in the data
if start_date < df[time_col].min() or end_date > df[time_col].max():
raise ValueError("Start date or end date is beyond the data range")
if start_date > end_date:
raise ValueError("Start date cannot be after end date")
# make sure all the categories in consumption distribution are present in the data
merch_categories = df["merch_category"].unique()
for category in consumption_distribution.keys():
Expand Down

0 comments on commit ae87f9a

Please sign in to comment.