Skip to content

Commit

Permalink
Substract 365 days instead of 1 year. (#2036)
Browse files Browse the repository at this point in the history
  • Loading branch information
melisabok authored Feb 29, 2024
1 parent 31ab445 commit ca757dc
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions openreview/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
2 changes: 1 addition & 1 deletion tests/test_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,7 @@ def test_get_conflicts(self, client, helpers):

test_profile = openreview.tools.get_profiles(client, ['[email protected]'], with_relations=True)[0]
user_profiles = openreview.tools.get_profiles(client, ['[email protected]'], 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'
Expand Down

0 comments on commit ca757dc

Please sign in to comment.