Skip to content

Commit

Permalink
Add license to revision invitation (#2160)
Browse files Browse the repository at this point in the history
* Add license to revision invitation

* Add license to PC revision
  • Loading branch information
enrubio authored May 17, 2024
1 parent 725b177 commit 15ed978
Show file tree
Hide file tree
Showing 4 changed files with 99 additions and 7 deletions.
3 changes: 2 additions & 1 deletion openreview/stages/venue_stages.py
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@ def __init__(self, start_date = None, due_date = None, include_option = False):

class SubmissionRevisionStage():

def __init__(self, name='Revision', start_date=None, due_date=None, additional_fields={}, remove_fields=[], only_accepted=False, multiReply=None, allow_author_reorder=False):
def __init__(self, name='Revision', start_date=None, due_date=None, additional_fields={}, remove_fields=[], only_accepted=False, multiReply=None, allow_author_reorder=False, allow_license_edition=False):
self.name = name
self.start_date = start_date
self.due_date = due_date
Expand All @@ -490,6 +490,7 @@ def __init__(self, name='Revision', start_date=None, due_date=None, additional_f
self.only_accepted = only_accepted
self.multiReply=multiReply
self.allow_author_reorder=allow_author_reorder
self.allow_license_edition=allow_license_edition

def get_content(self, api_version='2', conference=None):

Expand Down
30 changes: 30 additions & 0 deletions openreview/venue/invitation.py
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,7 @@ def set_post_submission_invitation(self):

def set_pc_submission_revision_invitation(self):
venue_id = self.venue_id
submission_license = self.venue.submission_license
submission_stage = self.venue.submission_stage
cdate = tools.datetime_millis(submission_stage.exp_date) if submission_stage.exp_date else None

Expand Down Expand Up @@ -426,6 +427,20 @@ def set_pc_submission_revision_invitation(self):
process=self.get_process_content('process/pc_submission_revision_process.py')
)

# Allow PCs to revise license
if submission_license:
if isinstance(submission_license, str):
submission_invitation.edit['note']['license'] = submission_license
elif len(submission_license) == 1:
submission_invitation.edit['note']['license'] = submission_license[0]
else:
license_options = [ { "value": license, "description": license } for license in submission_license ]
submission_invitation.edit['note']['license'] = {
"param": {
"enum": license_options
}
}

submission_invitation = self.save_invitation(submission_invitation, replacement=True)

def set_review_invitation(self):
Expand Down Expand Up @@ -2498,6 +2513,7 @@ def set_desk_rejection_invitation(self):
def set_submission_revision_invitation(self, submission_revision_stage=None):

venue_id = self.venue_id
submission_license = self.venue.submission_license
revision_stage = submission_revision_stage if submission_revision_stage else self.venue.submission_revision_stage
revision_invitation_id = self.venue.get_invitation_id(revision_stage.name)
revision_cdate = tools.datetime_millis(revision_stage.start_date if revision_stage.start_date else datetime.datetime.utcnow())
Expand Down Expand Up @@ -2604,6 +2620,20 @@ def set_submission_revision_invitation(self, submission_revision_stage=None):
if revision_expdate:
invitation.edit['invitation']['expdate'] = revision_expdate

# Allow license edition until full paper deadline
if submission_license and revision_stage.allow_license_edition:
if isinstance(submission_license, str):
invitation.edit['invitation']['edit']['note']['license'] = submission_license
elif len(submission_license) == 1:
invitation.edit['invitation']['edit']['note']['license'] = submission_license[0]
else:
license_options = [ { "value": license, "description": license } for license in submission_license ]
invitation.edit['invitation']['edit']['note']['license'] = {
"param": {
"enum": license_options
}
}

self.save_invitation(invitation, replacement=False)
return invitation

Expand Down
3 changes: 2 additions & 1 deletion openreview/venue/venue.py
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,8 @@ def create_submission_stage(self):
remove_fields=stage.second_deadline_remove_fields if stage.second_deadline_remove_fields else stage.remove_fields,
only_accepted=False,
multiReply=True,
allow_author_reorder=stage.author_reorder_after_first_deadline
allow_author_reorder=stage.author_reorder_after_first_deadline,
allow_license_edition=True
)
self.invitation_builder.set_submission_revision_invitation(submission_revision_stage)
self.invitation_builder.set_submission_deletion_invitation(submission_revision_stage)
Expand Down
70 changes: 65 additions & 5 deletions tests/test_iclr_conference_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ def test_create_conference(self, client, openreview_client, helpers, profile_man
helpers.create_user('reviewer5@gmail.com', 'Reviewer', 'ICLRFive')
helpers.create_user('reviewer6@gmail.com', 'Reviewer', 'ICLRSix')
helpers.create_user('reviewerethics@gmail.com', 'Reviewer', 'ICLRSeven')
helpers.create_user('peter@mail.com', 'Peter', 'SomeLastName') # Author

request_form_note = pc_client.post_note(openreview.Note(
invitation='openreview.net/Support/-/Request_Form',
Expand Down Expand Up @@ -269,11 +270,33 @@ def test_post_submission(self, client, openreview_client, helpers):
assert submission_invitation.expdate < openreview.tools.datetime_millis(now)

submissions = pc_client_v2.get_notes(invitation='ICLR.cc/2024/Conference/-/Submission', sort='number:asc')
submission = submissions[0]
assert len(submissions) == 11
assert submissions[0].license == 'CC BY-SA 4.0'
assert submissions[0].readers == ['everyone']
assert '_bibtex' in submissions[0].content
assert 'author={Anonymous}' in submissions[0].content['_bibtex']['value']
assert submission.license == 'CC BY-SA 4.0'
assert submission.readers == ['everyone']
assert '_bibtex' in submission.content
assert 'author={Anonymous}' in submission.content['_bibtex']['value']

# Author revises submission license
author_client = openreview.api.OpenReviewClient(username='peter@mail.com', password=helpers.strong_password)
revision_note = author_client.post_note_edit(
invitation = f'ICLR.cc/2024/Conference/Submission{submission.number}/-/Revision',
signatures = [f'ICLR.cc/2024/Conference/Submission{submission.number}/Authors'],
note = openreview.api.Note(
license = 'CC0 1.0',
content = {
'title': { 'value': submission.content['title']['value'] + ' license revision' },
'abstract': submission.content['abstract'],
'authorids': { 'value': submission.content['authorids']['value'] },
'authors': { 'value': submission.content['authors']['value'] },
'keywords': submission.content['keywords'],
'pdf': submission.content['pdf'],
}
))
helpers.await_queue_edit(openreview_client, edit_id=revision_note['id'])

submission = pc_client_v2.get_notes(invitation='ICLR.cc/2024/Conference/-/Submission', sort='number:asc')[0]
assert submission.license == 'CC0 1.0'

# Assert that activation date of matching invitation == abstract deadline
matching_invitation = client.get_invitation(f'openreview.net/Support/-/Request{request_form.number}/Paper_Matching_Setup')
Expand Down Expand Up @@ -316,7 +339,44 @@ def test_post_submission(self, client, openreview_client, helpers):
helpers.await_queue_edit(openreview_client, 'ICLR.cc/2024/Conference/-/Withdrawal-0-1', count=2)
helpers.await_queue_edit(openreview_client, 'ICLR.cc/2024/Conference/-/Desk_Rejection-0-1', count=2)

client.get_group('ICLR.cc/2024/Conference/Submission1/Reviewers')
# Author can't revise license after paper deadline
with pytest.raises(openreview.OpenReviewException, match=r'The Invitation ICLR.cc/2024/Conference/Submission1/-/Revision has expired'):
revision_note = author_client.post_note_edit(
invitation = f'ICLR.cc/2024/Conference/Submission{submission.number}/-/Revision',
signatures = [f'ICLR.cc/2024/Conference/Submission{submission.number}/Authors'],
note = openreview.api.Note(
license = 'CC BY 4.0',
content = {
'title': submission.content['title'],
'abstract': submission.content['abstract'],
'authorids': { 'value': submission.content['authorids']['value'] },
'authors': { 'value': submission.content['authors']['value'] },
'keywords': submission.content['keywords'],
'pdf': submission.content['pdf'],
}
))

# PC revises submission license
pc_revision = pc_client_v2.post_note_edit(
invitation='ICLR.cc/2024/Conference/-/PC_Revision',
signatures=['ICLR.cc/2024/Conference/Program_Chairs'],
note=openreview.api.Note(
id = submission.id,
license = 'CC BY 4.0',
content = {
'title': submission.content['title'],
'abstract': submission.content['abstract'],
'authorids': { 'value': submission.content['authorids']['value'] },
'authors': { 'value': submission.content['authors']['value'] },
'keywords': submission.content['keywords'],
'pdf': submission.content['pdf'],
}
))

helpers.await_queue_edit(openreview_client, edit_id=pc_revision['id'])

submission = pc_client_v2.get_notes(invitation='ICLR.cc/2024/Conference/-/Submission', sort='number:asc')[0]
assert submission.license == 'CC BY 4.0'

def test_review_stage(self, client, openreview_client, helpers, test_client):

Expand Down

0 comments on commit 15ed978

Please sign in to comment.