From d33516e2a10ee292df228fc4b8683fa5f2850e59 Mon Sep 17 00:00:00 2001 From: willemjan Date: Sat, 5 Sep 2026 22:38:07 +0200 Subject: [PATCH] Avoid pandas Timedelta(days=1) deprecation warning pd.Timedelta(days=1) triggers a DeprecationWarning about NumPy's "generic" timedelta unit in this pandas version; pd.Timedelta(1, unit="D") is equivalent and warning-free. --- pages/1_Live.py | 2 +- pages/4_Dagoverzicht.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pages/1_Live.py b/pages/1_Live.py index 9052a84..6687d04 100644 --- a/pages/1_Live.py +++ b/pages/1_Live.py @@ -45,7 +45,7 @@ def _basal_and_target_series(profile: dict, treatments: pd.DataFrame, window_sta dates = pd.date_range(window_start.normalize(), window_end.normalize(), freq="D") basal_parts, target_parts = [], [] for day_start in dates: - day_end = day_start + pd.Timedelta(days=1) + day_end = day_start + pd.Timedelta(1, unit="D") basal_parts.append(effective_basal_series(profile, treatments, day_start, day_end)) target_parts.append(target_glucose_series(profile, day_start, day_end)) diff --git a/pages/4_Dagoverzicht.py b/pages/4_Dagoverzicht.py index 6584a08..0bc6e5a 100644 --- a/pages/4_Dagoverzicht.py +++ b/pages/4_Dagoverzicht.py @@ -90,7 +90,7 @@ fig = make_subplots( for i, day in enumerate(dates, start=1): day_df = glucose[glucose["date"] == day] day_start = pd.Timestamp(day) - day_end = day_start + pd.Timedelta(days=1) + day_end = day_start + pd.Timedelta(1, unit="D") fig.add_hrect( y0=TARGET_LOW, y1=TARGET_HIGH, fillcolor=colors["band"], line_width=0, layer="below", row=i, col=1