Skip to content

Commit

Permalink
Feature/group invitation (#1610)
Browse files Browse the repository at this point in the history
* propagate change to all the children

* propagate changes using a date process function

* wait until process function is done

* test neurips workflow using API 2

* fix read scores from file, support ethics committee

* remove print

* fix tests

* see dates in the super invitation

* use the same process function when the invitation is created and updated

* integrate profile bidding

* link the dates from the upper invitation to the inner invitations

* fix tests

* create submission revision invitations using the date process function

* remove unused code

* fix key error

* get process logs to check it is ok

* remove unnecessary awaits

* check the process logs is >= than count

* remove unused data

* remove print

* remove import

* fix process function variable

* propagate changes for rebuttal invitation

* remove unused code

* refactor date processes configuration

* fix tests

* create withdraw and desk rejection invitation at submission expiration time

* remove unused code

* fix awaits

* add more awaits

* use an invitation to compute the post submission stage

* fix withdrawn note notifications

* configure withawal pc notification

* fix supplementary material revision

* fix submission revision stage

* fix more tests

* fix argument missing

* replace post_submission_stage with create_post_submission_stage

* get profile with superuser

* running date process function when the invitation is active not before

* remove extra line

* fix test

* fix more tests

* create group invitation to create reviewer groups

* create submitted reviewers in process function

* remove unused code

* create reviewers/submitted group before sending the email

* set readers of the submission

* create submission stage only when it is needed and all the invitations for late submissions

* fix withdraw invitation should expire comments

* update meta invitation and avoid replacement on upper invitations

* move get content to each stage and remove fields from the invitation

* get invitations by type

* fixes during testing

* fix build content for submission stage

* use different wait time

* change wait time value
  • Loading branch information
melisabok authored Mar 30, 2023
1 parent 0349475 commit e8d7bc9
Show file tree
Hide file tree
Showing 17 changed files with 688 additions and 280 deletions.
26 changes: 20 additions & 6 deletions openreview/api/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -1467,7 +1467,7 @@ def add_members_to_group(self, group, members):
def add_member(group, members):
group = self.get_group(group) if type(group) in string_types else group
if group.invitations:
self.post_group_edit(invitation = group.invitations[0],
self.post_group_edit(invitation = f'{group.domain}/-/Edit',
signatures = group.signatures,
group = Group(
id = group.id,
Expand Down Expand Up @@ -1507,7 +1507,7 @@ def remove_members_from_group(self, group, members):
def remove_member(group, members):
group = self.get_group(group) if type(group) in string_types else group
if group.invitations:
self.post_group_edit(invitation = group.invitations[0],
self.post_group_edit(invitation = f'{group.domain}/-/Edit',
signatures = group.signatures,
group = Group(
id = group.id,
Expand Down Expand Up @@ -1680,14 +1680,16 @@ def post_note_edit(self, invitation, signatures, note=None, readers=None, writer

return response.json()

def post_group_edit(self, invitation, signatures, group=None, readers=None, writers=None):
def post_group_edit(self, invitation, signatures=None, group=None, readers=None, writers=None, content=None, replacement=None):
"""
"""
edit_json = {
'invitation': invitation,
'group': group.to_json() if group else {}
'invitation': invitation
}

if group is not None:
edit_json['group'] = group.to_json()

if signatures is not None:
edit_json['signatures'] = signatures

Expand All @@ -1697,6 +1699,12 @@ def post_group_edit(self, invitation, signatures, group=None, readers=None, writ
if writers is not None:
edit_json['writers'] = writers

if content is not None:
edit_json['content'] = content

if replacement is not None:
edit_json['replacement'] = replacement

response = requests.post(self.group_edits_url, json = edit_json, headers = self.headers)
response = self.__handle_response(response)

Expand Down Expand Up @@ -2169,6 +2177,12 @@ def __repr__(self):
def __str__(self):
pp = pprint.PrettyPrinter()
return pp.pformat(vars(self))

def is_active(self):
now = tools.datetime_millis(datetime.datetime.utcnow())
cdate = self.cdate if self.cdate else now
edate = self.expdate if self.expdate else now
return cdate <= now and now <= edate

def is_active(self):
now = tools.datetime_millis(datetime.datetime.utcnow())
Expand Down Expand Up @@ -2426,7 +2440,7 @@ class Group(object):
:param details:
:type details: optional
"""
def __init__(self, id, content=None, readers=None, writers=None, signatories=None, signatures=None, invitation=None, invitations=None, cdate = None, ddate = None, tcdate=None, tmdate=None, members = None, nonreaders = None, impersonators=None, web = None, anonids= None, deanonymizers=None, host=None, domain=None, parent = None, details = None):
def __init__(self, id=None, content=None, readers=None, writers=None, signatories=None, signatures=None, invitation=None, invitations=None, cdate = None, ddate = None, tcdate=None, tmdate=None, members = None, nonreaders = None, impersonators=None, web = None, anonids= None, deanonymizers=None, host=None, domain=None, parent = None, details = None):
# post attributes
self.id=id
self.invitation=invitation
Expand Down
4 changes: 4 additions & 0 deletions openreview/conference/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,10 @@ def set_reviewers_name(self, name):
def set_submission_stage(self, stage):
self.submission_stage = stage
return self.__create_submission_stage()

## API2 only
def create_submission_stage(self):
return

def set_expertise_selection_stage(self, stage):
self.expertise_selection_stage = stage
Expand Down
1 change: 0 additions & 1 deletion openreview/conference/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ def get_conference(client, request_form_id, support_user='OpenReview.net/Support

if setup:
venue.setup(note.content.get('program_chair_emails'))
venue.create_submission_stage()
return venue

builder = get_conference_builder(client, request_form_id, support_user)
Expand Down
Loading

0 comments on commit e8d7bc9

Please sign in to comment.