def build_groups(conference_group_id): # create list of subpaths (e.g. Test.com, Test.com/TestConference, Test.com/TestConference/2018) path_components = conference_group_id.split('/') paths = [ '/'.join(path_components[0:index + 1]) for index, path in enumerate(path_components) ] empty_params = { 'readers': ['everyone'], 'writers': [], 'signatures': [], 'signatories': [], 'members': [] } groups = {p: openreview.Group(p, **empty_params) for p in paths} groups[conference_group_id].writers = groups[ conference_group_id].signatories = [conference_group_id] admin_id = conference_group_id + '/Admin' groups[admin_id] = openreview.Group(admin_id, readers=[admin_id], signatories=[admin_id]) return groups
def init_source_groups(client): # create the source groups (or overwrite it if it exists) source_group = openreview.Group(id=source_entity, signatures=['OpenReview.net'], signatories=[source_entity], readers=[source_entity], writers=['OpenReview.net'], members=[]) client.post_group(source_group) source_id_group = openreview.Group(id=source_id, signatures=['OpenReview.net'], signatories=[source_id], readers=[source_id], writers=['OpenReview.net'], members=[]) client.post_group(source_id_group)
def test_replace_members_with_ids(self, client, test_client): posted_group = client.post_group( openreview.Group( id='test.org', readers=['everyone'], writers=['~Super_User1'], signatures=['~Super_User1'], signatories=['~Super_User1'], members=['*****@*****.**', '~Test_User1', '~Another_Name1'])) assert posted_group client.post_profile( openreview.Profile(referent='~Test_User1', signatures=['~Test_User1'], content={ 'names': [{ 'first': 'Another', 'last': 'Name', 'username': '******' }] })) replaced_group = openreview.tools.replace_members_with_ids( client, posted_group) assert replaced_group assert replaced_group.members == ['~Test_User1'] posted_group = client.post_group( openreview.Group(id='test.org', readers=['everyone'], writers=['~Super_User1'], signatures=['~Super_User1'], signatories=['~Super_User1'], members=[ '~Super_User1', '~Another_Name1', '*****@*****.**' ])) replaced_group = openreview.tools.replace_members_with_ids( client, posted_group) assert replaced_group assert replaced_group.members == [ '~Super_User1', '~Test_User1', '*****@*****.**' ] # Test to assert that member is removed while running replace members on a group has a member that is an invalid profile invalid_member_group = client.add_members_to_group( replaced_group, '~Invalid_Profile1') assert len(invalid_member_group.members) == 4 assert '~Invalid_Profile1' in invalid_member_group.members replaced_group = openreview.tools.replace_members_with_ids( client, invalid_member_group) assert len(replaced_group.members) == 3 assert '~Invalid_Profile1' not in invalid_member_group.members
def post_submission_groups(client, conference_id, submission_invite, chairs): ''' Create paper group, authors group, reviewers group, review non-readers group for all notes returned by the submission_invite. ''' submissions = client.get_notes(invitation=submission_invite) for paper in submissions: paper_num = str(paper.number) print("Adding groups for Paper" + paper_num) ## Paper Group paperGroup = conference_id + '/Paper' + paper_num client.post_group( openreview.Group(id=paperGroup, signatures=[conference_id], writers=[conference_id], members=[], readers=['everyone'], signatories=[])) ## Author group authorGroup = paperGroup + '/Authors' client.post_group( openreview.Group(id=authorGroup, signatures=[conference_id], writers=[conference_id], members=paper.content['authorids'], readers=[conference_id, chairs, authorGroup], signatories=[])) ## Reviewer group - people that can see the review invitation reviewerGroup = paperGroup + '/Reviewers' client.post_group( openreview.Group(id=reviewerGroup, signatures=[conference_id], writers=[conference_id], members=[], readers=[conference_id, chairs], signatories=[])) ## NonReviewers - people that aren't allowed to see the reviews. # Used to prevent reviewers from seeing other reviews of that paper # until their review is complete. nonReviewerGroup = reviewerGroup + '/NonReaders' client.post_group( openreview.Group(id=nonReviewerGroup, signatures=[conference_id], writers=[conference_id], members=[], readers=[conference_id, chairs], signatories=[]))
def create_profile(client, email, first, last, middle=None, allow_duplicates=False): profile = get_profile(client, email) if not profile: response = client.get_tildeusername(first, last, middle) tilde_id = response['username'].encode('utf-8') if tilde_id.endswith(last + '1') or allow_duplicates: tilde_group = openreview.Group(id=tilde_id, signatures=[super_user_id], signatories=[tilde_id], readers=[tilde_id], writers=[super_user_id], members=[email]) email_group = openreview.Group(id=email, signatures=[super_user_id], signatories=[email], readers=[email], writers=[super_user_id], members=[tilde_id]) profile_content = { 'emails': [email], 'preferred_email': email, 'names': [{ 'first': first, 'middle': middle, 'last': last, 'username': tilde_id }] } client.post_group(tilde_group) client.post_group(email_group) profile = client.post_profile(tilde_id, profile_content) return profile else: raise openreview.OpenReviewException( 'There is already a profile with this first: {0}, middle: {1}, last name: {2}' .format(first, middle, last)) else: return profile
def build_groups(conference_group_id, default_params=None): ''' Given a group ID, returns a list of empty groups that correspond to the given group's subpaths (e.g. Test.com, Test.com/TestConference, Test.com/TestConference/2018) ''' path_components = conference_group_id.split('/') paths = [ '/'.join(path_components[0:index + 1]) for index, path in enumerate(path_components) ] if not default_params: default_params = { 'readers': ['everyone'], 'writers': [], 'signatures': [], 'signatories': [], 'members': [] } groups = {p: openreview.Group(p, **default_params) for p in paths} groups[conference_group_id].writers = groups[ conference_group_id].signatories = [conference_group_id] return sorted(groups.values(), key=lambda x: len(x.id))
def test_setup(self, client, request_page, selenium): ##Create support group support_group = openreview.Group( id='openreview.net/Support', readers=['everyone'], writers=['openreview.net/Support'], signatures=['openreview.net'], signatories=['openreview.net/Support'], members=[], ) client.post_group(support_group) agora = openreview.agora.Agora(client, support_group.id, 'openreview.net', '*****@*****.**') request_page(selenium, "http://localhost:3030/group?id=-Agora/COVID-19") header = selenium.find_element_by_id('header') assert header invitation_panel = selenium.find_element_by_id('invitation') assert invitation_panel notes_panel = selenium.find_element_by_id('notes') assert notes_panel tabs = notes_panel.find_element_by_class_name('tabs-container') assert tabs with pytest.raises(NoSuchElementException): notes_panel.find_element_by_class_name('spinner-container')
def get_reviewer_groups(client, paper_number, conference, group_params, parent_label, individual_label): ''' This is only intended to be used as a local helper function @paper_number: the number of the paper to assign @conference: the ID of the conference being assigned @group_params: optional parameter that overrides the default ''' # get the parent group if it already exists, and create it if it doesn't. try: parent_group = client.get_group('{}/Paper{}/{}'.format( conference, paper_number, parent_label)) except openreview.OpenReviewException as e: if 'Group Not Found' in e[0][0]: # Set the default values for the parent and individual groups group_params_default = { 'readers': [conference, '{}/Program_Chairs'.format(conference)], 'writers': [conference], 'signatures': [conference], 'signatories': [] } group_params_default.update(group_params) group_params = group_params_default parent_group = client.post_group( openreview.Group( id='{}/Paper{}/{}'.format(conference, paper_number, parent_label), nonreaders=[ '{}/Paper{}/Authors'.format(conference, paper_number) ], **group_params)) else: raise e ''' get the existing individual groups, while making sure that the parent group isn't included. This can happen if the parent group and the individual groups are named similarly. For example, if: parent_group_label = "Area_Chairs" individual_group_label = "Area_Chairs" Then the call for individual groups by wildcard will pick up all the individual groups AND the parent group. ''' individual_groups = client.get_groups(id='{}/Paper{}/{}.*'.format( conference, paper_number, individual_label)) individual_groups = [ g for g in individual_groups if g.id != parent_group.id ] unassigned_individual_groups = sorted( [a for a in individual_groups if a.members == []], key=lambda x: x.id) return [parent_group, individual_groups, unassigned_individual_groups]
def test_add_members_to_group(self, client): new_group = client.post_group( openreview.Group(id='NewGroup', members=[], signatures=['~Super_User1'], signatories=['NewGroup'], readers=['everyone'], writers=['NewGroup'])) assert new_group # Test that add_members_to_group works while passing it a Group object and one member of type string posted_group = client.add_members_to_group(new_group, '*****@*****.**') assert posted_group assert len(posted_group.members) == 1 assert '*****@*****.**' in posted_group.members # Test that add_members_to_group works while passing it a Group object and a list of members each of type string posted_group = client.add_members_to_group( posted_group, ['*****@*****.**', '*****@*****.**']) assert posted_group assert len(posted_group.members) == 3 assert '*****@*****.**' in posted_group.members assert '*****@*****.**' in posted_group.members assert '*****@*****.**' in posted_group.members # Test that add_members_to_group works while passing it a Group id string and one member of type string posted_group = client.add_members_to_group(posted_group.id, '*****@*****.**') assert posted_group assert len(posted_group.members) == 4 assert '*****@*****.**' in posted_group.members assert '*****@*****.**' in posted_group.members assert '*****@*****.**' in posted_group.members assert '*****@*****.**' in posted_group.members # Test that add_members_to_group works while passing it a Group id string and a list of members each of type string posted_group = client.add_members_to_group( posted_group, ['*****@*****.**', '*****@*****.**']) assert posted_group assert len(posted_group.members) == 6 assert '*****@*****.**' in posted_group.members assert '*****@*****.**' in posted_group.members assert '*****@*****.**' in posted_group.members assert '*****@*****.**' in posted_group.members assert '*****@*****.**' in posted_group.members assert '*****@*****.**' in posted_group.members # Test that adding an existing member should not have any effect posted_group = client.add_members_to_group( posted_group, ['*****@*****.**', '*****@*****.**']) assert posted_group assert len(posted_group.members) == 6
def create_reviewer_group(new_reviewer_id, reviewer, paper_number, conflict_list): new_reviewer = openreview.Group( new_reviewer_id, signatures=['auai.org/UAI/2017'], writers=['auai.org/UAI/2017'], members=[reviewer], readers=[CONFERENCE, COCHAIRS, 'auai.org/UAI/2017/Paper%s/Area_Chair' % paper_number, new_reviewer_id], nonreaders=conflict_list, signatories=[new_reviewer_id]) client.post_group(new_reviewer) return new_reviewer
def create_reviewer_group(new_reviewer_id, reviewer, conflict_list): new_reviewer = openreview.Group(new_reviewer_id, signatures=[TRACK], writers=[TRACK], members=[reviewer], readers=[TRACK, COCHAIRS, new_reviewer_id], nonreaders=conflict_list, signatories=[new_reviewer_id]) client.post_group(new_reviewer) print "assigned user %s to group %s" % (reviewer, new_reviewer_id) return new_reviewer
def create_reviewer_group(new_reviewer_id, reviewer, paper_number, conflict_list): new_reviewer = openreview.Group( new_reviewer_id, signatures=['ICLR.cc/2017/workshop'], writers=['ICLR.cc/2017/workshop'], members=[reviewer], readers=['ICLR.cc/2017/workshop', 'ICLR.cc/2017/pcs', new_reviewer_id], nonreaders=conflict_list, signatories=[new_reviewer_id]) client.post_group(new_reviewer) print "assigned user %s to group %s" % (reviewer, new_reviewer_id) return new_reviewer
if not client.exists(groupid) or overwrite == True: return True else: return False if client.user['id'].lower() == 'openreview.net': ######################### ## SETUP GROUPS ## ######################### if not client.exists('cv-foundation.org'): cvfoundation = openreview.Group('cv-foundation.org', readers=['everyone'], writers=['OpenReview.net'], signatures=['OpenReview.net'], signatories=[], members=[]) groups.append(cvfoundation) if not client.exists('cv-foundation.org/CVPR'): cvpr = openreview.Group('cv-foundation.org/CVPR', readers=['everyone'], writers=['OpenReview.net'], signatures=['OpenReview.net'], signatories=[], members=[]) groups.append(cvpr) if not client.exists('cv-foundation.org/CVPR/2017'): cvpr2017 = openreview.Group('cv-foundation.org/CVPR/2017',
call(["node", "../../scripts/processToFile.js", "../process/submissionProcess_workshop.template", "../process"]) if client.user['id'].lower()=='openreview.net': # We're going to populate the list of workshop/reviewers from the list of conference/reviewers-invited, # so we only need to create groups for the reviewers themselves ('ICLR.cc/2017/workshop/reviewers') and # for the list of reviewers that have been emailed about serving as a workshop reviewer. pcs = client.get_group('ICLR.cc/2017/pcs') client.add_members_to_group(pcs,['ICLR.cc/2017/workshop','ICLR.cc/2017/conference']) if overwrite_allowed('ICLR.cc/2017/workshop'): iclr2017workshop = openreview.Group('ICLR.cc/2017/workshop', readers = ['everyone'], writers = ['ICLR.cc/2017','ICLR.cc/2017/pcs','ICLR.cc/2017/workshop'], signatures = ['ICLR.cc/2017'], signatories = ['ICLR.cc/2017/workshop'], members = ['ICLR.cc/2017/pcs'], web = '../webfield/iclr2017workshop_webfield.html') groups.append(iclr2017workshop) if overwrite_allowed('ICLR.cc/2017/workshop/reviewers-emailed'): iclr2017reviewersemailed = openreview.Group('ICLR.cc/2017/workshop/reviewers-emailed', readers=['ICLR.cc/2017/pcs','ICLR.cc/2017'], writers=['ICLR.cc/2017/pcs'], signatures=['ICLR.cc/2017/pcs'], signatories=['ICLR.cc/2017/workshop/reviewers-emailed'], members=[]) groups.append(iclr2017reviewersemailed) if overwrite_allowed('ICLR.cc/2017/workshop/reviewers-declined'):
def assign(client, paper_number, reviewer_to_add=None, reviewer_to_remove=None): try: reviewers_group = client.get_group( 'ICLR.cc/2018/Workshop/Paper{0}/Reviewers'.format(paper_number)) except openreview.OpenReviewException as e: if e[0][0]['type'] == 'Not Found': reviewers_group = client.post_group( openreview.Group( **{ 'id': 'ICLR.cc/2018/Workshop/Paper{0}/Reviewers'.format( paper_number), 'readers': [ 'ICLR.cc/2018/Workshop', 'ICLR.cc/2018/Workshop/Program_Chairs' ], 'nonreaders': [ 'ICLR.cc/2018/Workshop/Paper{0}/Authors'.format( paper_number) ], 'members': [], 'writers': [ 'ICLR.cc/2018/Workshop', 'ICLR.cc/2018/Workshop/Program_Chairs' ], 'signatures': ['ICLR.cc/2018/Workshop'], 'signatories': [] })) else: raise e anonreviewer_groups = client.get_groups( id='ICLR.cc/2018/Workshop/Paper{0}/AnonReviewer.*'.format( paper_number)) empty_anonreviewer_groups = sorted( [a for a in anonreviewer_groups if a.members == []], key=lambda x: x.id) if reviewer_to_remove: assigned_anonreviewer_groups = [ a for a in anonreviewer_groups if reviewer_to_remove in a.members ] for anonreviewer_group in assigned_anonreviewer_groups: print "removing {0} from {1}".format(reviewer_to_remove, anonreviewer_group.id) client.remove_members_from_group(anonreviewer_group, reviewer_to_remove) empty_anonreviewer_groups.append(anonreviewer_group) empty_anonreviewer_groups = sorted(empty_anonreviewer_groups, key=lambda x: x.id) print "removing {0} from {1}".format(reviewer_to_remove, reviewers_group.id) client.remove_members_from_group(reviewers_group, reviewer_to_remove) if reviewer_to_add: paper = client.get_notes( invitation='ICLR.cc/2018/Workshop/-/Submission', number=paper_number)[0] user_domain_conflicts, user_relation_conflicts = openreview.tools.get_profile_conflicts( client, reviewer_to_add) paper_domain_conflicts, paper_relation_conflicts = openreview.tools.get_paper_conflicts( client, paper) domain_conflicts = paper_domain_conflicts.intersection( user_domain_conflicts) relation_conflicts = paper_relation_conflicts.intersection( user_relation_conflicts) if domain_conflicts: print "{:40s} XXX User has COI with the following domain: {}".format( reviewer_to_add, domain_conflicts) if relation_conflicts: print "{:40s} XXX User has COI with the following relation: {}".format( reviewer_to_add, relation_conflicts) if domain_conflicts or relation_conflicts: user_continue = raw_input( 'continue with assignment? y/[n]: ').lower() == 'y' else: user_continue = True if user_continue and reviewer_to_add not in reviewers_group.members: anonreviewer_id = next_anonreviewer_id(empty_anonreviewer_groups, anonreviewer_groups, paper_number) paper_authors = 'ICLR.cc/2018/Workshop/Paper{0}/Authors'.format( paper_number) anonymous_reviewer_group = openreview.Group( id=anonreviewer_id, readers=[ 'ICLR.cc/2018/Workshop', 'ICLR.cc/2018/Workshop/Program_Chairs', anonreviewer_id ], nonreaders=[paper_authors], writers=['ICLR.cc/2018/Workshop'], signatories=[anonreviewer_id], signatures=['ICLR.cc/2018/Workshop'], members=[reviewer_to_add]) print "{:40s} --> {}".format(reviewer_to_add, anonymous_reviewer_group.id) client.post_group(anonymous_reviewer_group) client.add_members_to_group(reviewers_group, reviewer_to_add) return True elif reviewer_to_add in reviewers_group.members: print "{:40s} === {}".format(reviewer_to_add, reviewers_group.id) return True else: print "aborting assignment." return False
def test_remove_members_from_group(self, client): new_group = client.post_group( openreview.Group(id='NewGroup', members=[], signatures=['~Super_User1'], signatories=['NewGroup'], readers=['everyone'], writers=['NewGroup'])) assert new_group assert len(new_group.members) == 0 posted_group = client.add_members_to_group(new_group.id, [ '*****@*****.**', '*****@*****.**', '*****@*****.**' ]) assert posted_group assert len(posted_group.members) == 3 # Test that remove_members_from_group works while passing it a Group object and one member of type string posted_group = client.remove_members_from_group( posted_group, '*****@*****.**') assert posted_group assert len(posted_group.members) == 2 assert '*****@*****.**' not in posted_group.members # Test that remove_members_from_group works while passing it a Group object and and a list of members each of type string posted_group = client.remove_members_from_group( posted_group, [ '*****@*****.**', '*****@*****.**', '*****@*****.**' ]) assert posted_group assert len(posted_group.members) == 0 posted_group = client.add_members_to_group(posted_group.id, [ '*****@*****.**', '*****@*****.**', '*****@*****.**', '*****@*****.**', '*****@*****.**' ]) assert posted_group assert len(posted_group.members) == 5 # Test that remove_members_from_group works while passing it a Group id string and one member of type string posted_group = client.remove_members_from_group( posted_group.id, '*****@*****.**') assert posted_group assert len(posted_group.members) == 4 assert '*****@*****.**' not in posted_group.members assert '*****@*****.**' in posted_group.members assert '*****@*****.**' in posted_group.members assert '*****@*****.**' in posted_group.members assert '*****@*****.**' in posted_group.members # Test that remove_members_from_group works while passing it a Group id string and a list of members each of type string posted_group = client.remove_members_from_group( posted_group.id, ['*****@*****.**', '*****@*****.**']) assert posted_group assert len(posted_group.members) == 2 assert '*****@*****.**' in posted_group.members assert '*****@*****.**' in posted_group.members # Test that remove_members_from_group does not affect the group if the input member/members are already not in group.members posted_group = client.remove_members_from_group( posted_group.id, ['*****@*****.**', '*****@*****.**']) assert posted_group assert len(posted_group.members) == 2 assert '*****@*****.**' in posted_group.members assert '*****@*****.**' in posted_group.members
}, remove_fields=['keywords', 'TL;DR']) #Override process function with open('../process/submissionProcess.js') as f: submission_invitation.readers = [conference.get_authors_id()] submission_invitation.process = f.read() client.post_invitation(submission_invitation) conference.set_program_chairs(emails=[]) # paste real emails conference.set_reviewers(emails=[]) # past real emails # Override author group author_group = openreview.Group(id=conference.get_authors_id(), readers=[conference.get_program_chairs_id()], writers=[conference.get_program_chairs_id()], signatories=[[conference.get_authors_id()]], signatures=[conference.get_id()], members=[]) client.post_group(author_group) # Badging decision invitation for Chairs badging_decision_inv = openreview.Invitation( id=conference.get_id() + '/-/Decision', duedate=1575732251000, #GMT: Saturday, December 7, 2019 3:24:11 PM readers=['everyone'], writers=[conference.get_id()], signatures=[conference.get_id()], invitees=[conference.get_program_chairs_id()], multiReply=True, taskCompletionCount=1000, reply={
def add_assignment(client, paper_number, conference, reviewer, parent_group_params={}, individual_group_params={}, parent_label='Reviewers', individual_label='AnonReviewer'): ''' "individual groups" are groups with a single member; e.g. conference.org/Paper1/AnonReviewer1 "parent group" is the group that contains the individual groups; e.g. conference.org/Paper1/Reviewers @paper_number: the number of the paper to assign @conference: the ID of the conference being assigned @reviewer: may be an email address or a tilde ID; adds the given user to the parent and individual groups defined by the paper number, conference, and labels @parent_group_params: optional parameter that overrides the default @individual_group_params: optional parameter that overrides the default ''' result = get_reviewer_groups(client, paper_number, conference, parent_group_params, parent_label, individual_label) parent_group = result[0] individual_groups = result[1] unassigned_individual_groups = result[2] ''' Adds the given user to the parent group, and to the next empty individual group. Prints the results to the console. ''' profile = get_profile(client, reviewer) user = profile.id if profile else reviewer if user not in parent_group.members: client.add_members_to_group(parent_group, user) print "{:40s} --> {}".format(user.encode('utf-8'), parent_group.id) assigned_individual_groups = [ a for a in individual_groups if user in a.members ] if not assigned_individual_groups: # assign reviewer to group suffix = next_individual_suffix(unassigned_individual_groups, individual_groups, individual_label) anonreviewer_id = '{}/Paper{}/{}'.format(conference, paper_number, suffix) paper_authors = '{}/Paper{}/Authors'.format(conference, paper_number) # Set the default values for the individual groups individual_group_params_default = { 'readers': [conference, '{}/Program_Chairs'.format(conference)], 'writers': [conference], 'signatures': [conference], 'signatories': [] } individual_group_params_default.update(individual_group_params) individual_group_params = individual_group_params_default individual_group = openreview.Group(id=anonreviewer_id, **individual_group_params) individual_group.readers.append(anonreviewer_id) individual_group.nonreaders.append(paper_authors) individual_group.signatories.append(anonreviewer_id) individual_group.members.append(user) print "{:40s} --> {}".format(user.encode('utf-8'), individual_group.id) return client.post_group(individual_group) else: # user already assigned to individual group(s) for g in assigned_individual_groups: print "{:40s} === {}".format(user.encode('utf-8'), g.id) return assigned_individual_groups[0]
""" parser = argparse.ArgumentParser() parser.add_argument('--baseurl', help="base URL") parser.add_argument('--username') parser.add_argument('--password') args = parser.parse_args() client = openreview.Client(baseurl=args.baseurl, username=args.username, password=args.password) groups = {} groups[config.PROGRAM_CHAIRS] = openreview.Group( config.PROGRAM_CHAIRS, **config.program_chairs_params) groups[config.AUTHORS] = openreview.Group(config.AUTHORS, **config.group_params) groups[config.AREA_CHAIRS] = openreview.Group(config.AREA_CHAIRS, **config.area_chairs_params) groups[config.AREA_CHAIRS_INVITED] = openreview.Group( config.AREA_CHAIRS_INVITED, **config.group_params) groups[config.AREA_CHAIRS_DECLINED] = openreview.Group( config.AREA_CHAIRS_DECLINED, **config.group_params) groups[config.AREA_CHAIRS_EMAILED] = openreview.Group( config.AREA_CHAIRS_EMAILED, **config.group_params) groups[config.REVIEWERS] = openreview.Group(config.REVIEWERS, **config.reviewer_group_params)
print "posting group {0}".format(g) client.post_group(groups[g]) # Add webfield for parent MIDL group group = client.get_group('MIDL.amsterdam/2018') print group.id with open('../../midl18-landing-webfield.html') as f: group.web = f.read() group.signatures = [client.signature] updated_group = client.post_group(group) # add admin group to the conference members client.add_members_to_group(groups[config.CONFERENCE_ID], config.CONFERENCE_ID + '/Admin') groups = {} groups[config.PROGRAM_CHAIRS] = openreview.Group(config.PROGRAM_CHAIRS, **config.program_chairs_params) groups[config.AREA_CHAIRS] = openreview.Group(config.AREA_CHAIRS, **config.group_params) groups[config.REVIEWERS] = openreview.Group(config.REVIEWERS, **config.group_params) groups[config.CONFERENCE_ID] = client.get_group(config.CONFERENCE_ID) groups[config.CONFERENCE_ID].signatures = [client.signature] groups[config.CONFERENCE_ID].add_webfield(config.WEBPATH) invitations = {} invitations[config.SUBMISSION] = openreview.Invitation(config.SUBMISSION, duedate=config.SUBMISSION_TIMESTAMP, **config.submission_params) invitations[config.COMMENT] = openreview.Invitation(config.COMMENT, **config.comment_params) invitations[config.SUBMISSION].reply = config.submission_reply invitations[config.COMMENT].reply = config.comment_reply for g in groups.values():
def add_assignment(client, paper_number, conference, reviewer, parent_group_params={}, individual_group_params={}, parent_label='Reviewers', individual_label='AnonReviewer', use_profile=True): ''' | Assigns a reviewer to a paper. | Also adds the given user to the parent and individual groups defined by the paper number, conference, and labels | "individual groups" are groups with a single member; | e.g. conference.org/Paper1/AnonReviewer1 | "parent group" is the group that contains the individual groups; | e.g. conference.org/Paper1/Reviewers :arg paper_number: the number of the paper to assign :arg conference: the ID of the conference being assigned :arg reviewer: may be an email address or a tilde ID; :arg parent_group_params: optional parameter that overrides the default :arg individual_group_params: optional parameter that overrides the default ''' result = get_reviewer_groups(client, paper_number, conference, parent_group_params, parent_label, individual_label) parent_group = result[0] individual_groups = result[1] unassigned_individual_groups = result[2] ''' Adds the given user to the parent group, and to the next empty individual group. Prints the results to the console. ''' if use_profile: profile = get_profile(client, reviewer) user = profile.id if profile else reviewer else: user = reviewer affected_groups = set() client.add_members_to_group(parent_group, user) affected_groups.add(parent_group.id) assigned_individual_groups = [ a for a in individual_groups if user in a.members ] if not assigned_individual_groups: # assign reviewer to group suffix = next_individual_suffix(unassigned_individual_groups, individual_groups, individual_label) anonreviewer_id = '{}/Paper{}/{}'.format(conference, paper_number, suffix) paper_authors = '{}/Paper{}/Authors'.format(conference, paper_number) # Set the default values for the individual groups default_readers = [conference, '{}/Program_Chairs'.format(conference)] default_writers = [conference] default_signatures = [conference] default_nonreaders = [] default_members = [] default_signatories = [] readers = individual_group_params.get('readers', default_readers)[:] readers.append(anonreviewer_id) nonreaders = individual_group_params.get('nonreaders', default_nonreaders)[:] nonreaders.append(paper_authors) writers = individual_group_params.get('writers', default_writers)[:] members = individual_group_params.get('members', default_members)[:] members.append(user) signatories = individual_group_params.get('signatories', default_signatories)[:] signatories.append(anonreviewer_id) signatures = individual_group_params.get('signatures', default_signatures)[:] individual_group = openreview.Group(id=anonreviewer_id, readers=readers, nonreaders=nonreaders, writers=writers, members=members, signatories=signatories, signatures=signatures) client.post_group(individual_group) affected_groups.add(individual_group.id) else: # user already assigned to individual group(s) for g in assigned_individual_groups: affected_groups.add(g.id) return (user, list(affected_groups))
username - the email address of the logging in user password - the user's password """ if client.username.lower() != "openreview.net": raise(Exception('This script may only be run by the superuser')) path_components = config.CONF.split('/') paths = ['/'.join(path_components[0:index+1]) for index, path in enumerate(path_components)] for p in paths: if not client.exists(p) and p != config.CONF: client.post_group(openreview.Group( p, readers = ['everyone'], writers = [], signatures = [], signatories = [], members = [] )) print "Posting group: ", p conf_group = client.post_group(openreview.Group(config.CONF, **config.conf_params)) print "Posting group: ", config.CONF if not client.exists(config.ADMIN): admin_group = client.post_group(openreview.Group( config.ADMIN, readers = [config.ADMIN], signatories = [config.ADMIN] )) print "Posting group: ", config.ADMIN
program_chairs = conference.set_program_chairs([]) # add venue to active because it doesn't have an invitation open to everyone # so it won't show up under Open for Submission active_venues = client.get_group("active_venues") active_venues.members.append(conference_id) client.post_group(active_venues) # add the "Claimants" group client.post_group( openreview.Group( id=conference_id + '/Claimants', readers=[conference_id, conference.get_program_chairs_id()], nonreaders=[], writers=[conference_id], signatories=[conference_id], signatures=[conference_id], members=[])) # modify the "Report" invitation such that only claimants can post report_invitation = client.get_invitation(conference.get_submission_id()) report_invitation.invitees = [conference_id + '/Claimants'] report_invitation.noninvitees = [conference_id + '/Authors'] report_invitation.readers = [conference_id + '/Claimants'] report_invitation.nonreaders = [conference_id + '/Authors'] report_invitation.reply['readers'] = { 'values-copied': [ conference_id, "{content.authorids}", "{signatures}", conference_id + "/Reviewers",
from openreview import tools from openreview import invitations import datetime client = openreview.Client() print(client.baseurl) conference_id = 'reproducibility-challenge.github.io/Reproducibility_Challenge/NeurIPS/2019' #PAM TODO remember to expire Claim invites manually in November # Claimant group - those that will be able to see the Report Submisson button client.post_group( openreview.Group(id=conference_id + '/Claimants', readers=[conference_id + 'Program_Chairs'], nonreaders=[], writers=[conference_id], signatories=[conference_id], signatures=['~Super_User1'], members=[], details={'writable': True})) claim_inv = client.post_invitation( openreview.Invitation( id='{}/-/Claim'.format(conference_id), readers=['everyone'], invitees=['~'], writers=[conference_id], signatures=[conference_id], reply={ 'content': { 'title': { 'value': 'Claim',
if client.username.lower() != "openreview.net": raise (Exception('This script may only be run by the superuser')) # create groups for each directory level: Conf.org, Conf.org/2017, Conf.org/2017/Workshop path_components = config.CONF.split('/') paths = [ '/'.join(path_components[0:index + 1]) for index, path in enumerate(path_components) ] for p in paths: if not client.exists(p) and p != config.CONF: client.post_group( openreview.Group(p, readers=['everyone'], writers=[], signatures=[], signatories=[], members=[])) print "Posting group: ", p conf_group = client.post_group( openreview.Group(config.CONF, **config.conf_params)) print "Posting group: ", config.CONF if not client.exists(config.ADMIN): admin_group = client.post_group( openreview.Group(config.ADMIN, readers=[config.ADMIN], signatories=[config.ADMIN])) print "Posting group: ", config.ADMIN else:
parser.add_argument('--baseurl', help="base URL") parser.add_argument('--username') parser.add_argument('--password') args = parser.parse_args() print config.CONFERENCE_ID client = openreview.Client(baseurl=args.baseurl, username=args.username, password=args.password) print 'connecting to {0}'.format(client.baseurl) ''' set up the conference groups ''' conference_group = openreview.Group(**config.conference_params) groups = tools.build_groups(conference_group.id) for g in groups: # check group exists first try: group_exist = client.get_group(g.id) except openreview.OpenReviewException as e: client.post_group(g) print "post group " + g.id ''' Add homepage add to the conference group. ''' this_conference = client.get_group(config.CONFERENCE_ID) this_conference.add_webfield(config.WEBPATH) this_conference = client.post_group(this_conference)
client = openreview.Client(baseurl=args.baseurl, username=args.username, password=args.password) reviewer_group = client.get_group( 'thecvf.com/ECCV/2020/Conference/Reviewers') emergency_reviewer_group = client.post_group( openreview.Group( id='thecvf.com/ECCV/2020/Conference/Emergency_Reviewers', signatures=['thecvf.com/ECCV/2020/Conference'], signatories=[ 'thecvf.com/ECCV/2020/Conference/Emergency_Reviewers' ], readers=[ 'thecvf.com/ECCV/2020/Conference', 'thecvf.com/ECCV/2020/Conference/Area_Chairs', 'thecvf.com/ECCV/2020/Conference/Emergency_Reviewers' ], writers=[ 'thecvf.com/ECCV/2020/Conference', 'thecvf.com/ECCV/2020/Conference/Area_Chairs' ], members=[])) print('Posted group: {}\n'.format(emergency_reviewer_group.id)) emergency_load_invitation = client.post_invitation( openreview.Invitation( id= 'thecvf.com/ECCV/2020/Conference/Emergency_Reviewers/-/Custom_Max_Papers', signatures=['thecvf.com/ECCV/2020/Conference'], readers=[
parser = argparse.ArgumentParser() parser.add_argument('--baseurl', help="base URL") parser.add_argument('--username') parser.add_argument('--password') args = parser.parse_args() client = openreview.Client(baseurl=args.baseurl, username=args.username, password=args.password) groups = openreview.tools.build_groups('cv-foundation.org/ECCV/2018/Conference') for g in groups: client.post_group(g) reviewers_group = client.post_group(openreview.Group(**{ 'id': 'cv-foundation.org/ECCV/2018/Conference/Reviewers', 'readers': ['everyone'], 'writers': [], 'signatures': ['~Super_User1'], 'signatories': [], 'members': [] })) areachairs_group = client.post_group(openreview.Group(**{ 'id': 'cv-foundation.org/ECCV/2018/Conference/Area_Chairs', 'readers': ['everyone'], 'writers': [], 'signatures': ['~Super_User1'], 'signatories': [], 'members': [] })) programchairs_group = client.post_group(openreview.Group(**{ 'id': 'cv-foundation.org/ECCV/2018/Conference/Program_Chairs',
buddy_ac_parent_group = client.get_groups(regex=conference_id + '/' + buddy_ac_parent_group_name) if not buddy_ac_parent_group: ac_group = client.get_group(conference.get_area_chairs_id()) print( 'Posted ', client.post_group( openreview.Group( id=conference_id + '/' + buddy_ac_parent_group_name, readers=[ conference_id, conference.get_program_chairs_id(), conference.get_area_chairs_id() ], signatories=[ conference_id + '/' + buddy_ac_parent_group_name ], signatures=[conference_id], writers=[conference_id], web='buddyAreachairWebfield.js', members=ac_group.members)).id) map_meta_review_invitations = { invitation.id.split('Paper')[1].split('/')[0]: invitation for invitation in openreview.tools.iterget_invitations( client, regex=conference_id + '/Paper[0-9]+/-/Meta_Review') } map_paper_ac_parent_groups = { group.id.split('Paper')[1].split('/')[0]: group
def create_profile(client, email, first, last, middle=None, allow_duplicates=False): ''' Given email, first name, last name, and middle name (optional), creates and returns a user profile. If a profile with the same name exists, and allow_duplicates is False, an exception is raised. If a profile with the same name exists and allow_duplicates is True, a profile is created with the next largest number (e.g. if ~Michael_Spector1 exists, ~Michael_Spector2 will be created) ''' profile = get_profile(client, email) if not profile: # validate the name with just first and last names, # and also with first, middle, and last. # this is so that we catch more potential collisions; # let the caller decide what to do with false positives. username_response_FL_only = client.get_tildeusername(first, last, None) username_response_full = client.get_tildeusername(first, last, middle) # the username in each response will end with 1 # if profiles don't exist for those names username_FL_unclaimed = username_response_FL_only['username'].endswith( '1') username_full_unclaimed = username_response_full['username'].endswith( '1') if all([username_FL_unclaimed, username_full_unclaimed]): profile_exists = False else: profile_exists = True tilde_id = username_response_full['username'] if (not profile_exists) or allow_duplicates: tilde_group = openreview.Group(id=tilde_id, signatures=[super_user_id], signatories=[tilde_id], readers=[tilde_id], writers=[super_user_id], members=[email]) email_group = openreview.Group(id=email, signatures=[super_user_id], signatories=[email], readers=[email], writers=[super_user_id], members=[tilde_id]) profile_content = { 'emails': [email], 'preferredEmail': email, 'names': [{ 'first': first, 'middle': middle, 'last': last, 'username': tilde_id }] } client.post_group(tilde_group) client.post_group(email_group) profile = client.post_profile( openreview.Profile(id=tilde_id, content=profile_content)) return profile else: raise openreview.OpenReviewException( 'Failed to create new profile {tilde_id}: There is already a profile with the name: \"{first} {middle} {last}\"' .format(first=first, middle=middle, last=last, tilde_id=tilde_id)) else: raise openreview.OpenReviewException( 'There is already a profile with this email address: {}'.format( email))