diff --git a/drees.py b/drees.py index 7847fa2..40a9ee9 100644 --- a/drees.py +++ b/drees.py @@ -547,6 +547,13 @@ def plot_bar_vaccine_status_distribution_by_age_field( ) +def check_timestep(np_date: np.ndarray): + # get the difference between each element (return timedelta64 array) + np_diff = np.diff(np_date) + # check if all timestep are equals + assert np.all(np_diff == np_diff[0]), "some timesteps missing !" + + def get_age_vac_args() -> List[Tuple[AgeGroup, VacStatus]]: """ build pool age and vac status arguments @@ -669,6 +676,7 @@ if __name__ == "__main__": np_data, np_date = get_np_data(dic_data) lst_analyse_data = analyse(np_data) + check_timestep(np_date) if not args.no_plot: os.makedirs(OUTPUT_REPOSITORY, exist_ok=True)