From ca757dc6fe201a5bf5dbf800f1633d8f4fa345ef Mon Sep 17 00:00:00 2001 From: Melisa Bok Date: Thu, 29 Feb 2024 10:00:58 -0500 Subject: [PATCH] Substract 365 days instead of 1 year. (#2036) --- openreview/tools.py | 6 +++--- setup.py | 2 +- tests/test_tools.py | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/openreview/tools.py b/openreview/tools.py index c5f28a6f2..e817fe244 100644 --- a/openreview/tools.py +++ b/openreview/tools.py @@ -1382,7 +1382,7 @@ def get_profile_info(profile, n_years=None): if n_years: cut_off_date = datetime.datetime.now() - cut_off_date = cut_off_date.replace(year=cut_off_date.year - n_years) + cut_off_date = cut_off_date - datetime.timedelta(days=365 * n_years) cut_off_year = cut_off_date.year else: cut_off_year = -1 @@ -1442,7 +1442,7 @@ def get_neurips_profile_info(profile, n_years=None): if n_years: cut_off_date = datetime.datetime.now() - cut_off_date = cut_off_date.replace(year=cut_off_date.year - n_years) + cut_off_date = cut_off_date - datetime.timedelta(days=365 * n_years) cut_off_year = cut_off_date.year else: cut_off_year = -1 @@ -1509,7 +1509,7 @@ def get_current_submissions_profile_info(profile, n_years=None, submission_venue if n_years is not None: cut_off_date = datetime.datetime.now() - cut_off_date = cut_off_date.replace(year=cut_off_date.year - n_years) + cut_off_date = cut_off_date - datetime.timedelta(days=365 * n_years) cut_off_year = cut_off_date.year else: cut_off_year = -1 diff --git a/setup.py b/setup.py index b190791b5..dddea7001 100644 --- a/setup.py +++ b/setup.py @@ -3,7 +3,7 @@ setup( name='openreview-py', - version='1.36.1', + version='1.36.2', description='OpenReview API Python client library', url='https://github.com/openreview/openreview-py', diff --git a/tests/test_tools.py b/tests/test_tools.py index 3bf37b10e..02f41e705 100644 --- a/tests/test_tools.py +++ b/tests/test_tools.py @@ -480,7 +480,7 @@ def test_get_conflicts(self, client, helpers): test_profile = openreview.tools.get_profiles(client, ['test@mail.com'], with_relations=True)[0] user_profiles = openreview.tools.get_profiles(client, ['user2@qq.com'], with_relations=True) - conflicts = openreview.tools.get_conflicts(user_profiles, test_profile, policy='NeurIPS') + conflicts = openreview.tools.get_conflicts(user_profiles, test_profile, policy='NeurIPS', n_years=5) assert len(conflicts) == 1 assert conflicts[0] == '~SomeFirstName_User1'