From 14877903ecc33d3ea3375b31c15f3df347104472 Mon Sep 17 00:00:00 2001 From: Victor Lin <13424970+victorlin@users.noreply.github.com> Date: Wed, 1 Jun 2022 11:26:42 -0700 Subject: [PATCH] Use left-only inclusiveness for pd.date_range The `closed` parameter is deprecated in pandas==1.4.0, in favor of the `inclusive` parameter. See https://pandas.pydata.org/docs/reference/api/pandas.date_range.html --- augur/frequency_estimators.py | 3 ++- setup.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/augur/frequency_estimators.py b/augur/frequency_estimators.py index 48d335e3d..c4841477e 100644 --- a/augur/frequency_estimators.py +++ b/augur/frequency_estimators.py @@ -63,7 +63,8 @@ def get_pivots(observations, pivot_interval, start_date=None, end_date=None, piv datetime_pivots = pd.date_range( float_to_datestring(pivot_start), float_to_datestring(pivot_end), - freq = offset + freq = offset, + closed="left" ) pivots = np.array([timestamp_to_float(pivot) for pivot in datetime_pivots]) diff --git a/setup.py b/setup.py index f5eda48a4..1442c304b 100644 --- a/setup.py +++ b/setup.py @@ -57,7 +57,7 @@ "jsonschema >=3.0.0, ==3.*", "networkx >= 2.5, ==2.*", "packaging >=19.2", - "pandas >=1.0.0, ==1.*", + "pandas <1.4.0, ==1.*", "phylo-treetime ==0.8.*", "xopen >=1.0.1, ==1.*" ],