Skip to content

Commit

Permalink
Venue: add bid invitation to assignment configuration (#2111)
Browse files Browse the repository at this point in the history
* add bid invitation tp assignment configuration

* save scores spec in bid invitation

---------

Co-authored-by: Melisa Bok <melisabok@gmail.com>
  • Loading branch information
celestemartinez and melisabok authored Apr 25, 2024
1 parent 60d64f9 commit 7724f57
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 12 deletions.
34 changes: 33 additions & 1 deletion openreview/venue/invitation.py
Original file line number Diff line number Diff line change
Expand Up @@ -1144,6 +1144,18 @@ def set_bid_invitations(self):
}
}

bid_score_spec = {
'weight': 1,
'default': 0,
'translate_map' : {
'Very High': 1.0,
'High': 0.5,
'Neutral': 0.0,
'Low': -0.5,
'Very Low': -1.0
}
}

bid_invitation_id = venue.get_invitation_id(bid_stage.name, prefix=match_group_id)

template_name = 'profileBidWebfield.js' if match_group_id == venue.get_senior_area_chairs_id() and not venue.sac_paper_assignments else 'paperBidWebfield.js'
Expand All @@ -1163,7 +1175,8 @@ def set_bid_invitations(self):
minReplies = bid_stage.request_count,
web = webfield_content,
content = {
'committee_name': { 'value': venue.get_committee_name(match_group_id) }
'committee_name': { 'value': venue.get_committee_name(match_group_id) },
'scores_spec': { 'value': bid_score_spec }
},
edge = {
'id': {
Expand Down Expand Up @@ -1213,6 +1226,25 @@ def set_bid_invitations(self):

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

configuration_invitation = tools.get_invitation(self.client, f'{match_group_id}/-/Assignment_Configuration')
if configuration_invitation:
scores_spec = configuration_invitation.edit['note']['content']['scores_specification']
if bid_invitation.id not in scores_spec['value']['param']['default']:
scores_spec['value']['param']['default'][bid_invitation.id] = bid_score_spec
self.client.post_invitation_edit(invitations=venue.get_meta_invitation_id(),
signatures=[venue_id],
invitation=openreview.api.Invitation(
id=configuration_invitation.id,
edit={
'note': {
'content': {
'scores_specification': scores_spec
}
}
}
)
)

def set_official_comment_invitation(self):
venue_id = self.venue_id
comment_stage = self.venue.comment_stage
Expand Down
12 changes: 1 addition & 11 deletions openreview/venue/matching.py
Original file line number Diff line number Diff line change
Expand Up @@ -1063,17 +1063,7 @@ def setup(self, compute_affinity_scores=False, compute_conflicts=False, compute_

invitation = openreview.tools.get_invitation(self.client, venue.get_bid_id(self.match_group.id))
if invitation:
score_spec[invitation.id] = {
'weight': 1,
'default': 0,
'translate_map' : {
'Very High': 1.0,
'High': 0.5,
'Neutral': 0.0,
'Low': -0.5,
'Very Low': -1.0
}
}
score_spec[invitation.id] = invitation.content['scores_spec']['value']

invitation = openreview.tools.get_invitation(self.client, venue.get_recommendation_id(self.match_group.id))
if invitation:
Expand Down
9 changes: 9 additions & 0 deletions tests/test_sac_paper_matching.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,15 @@ def test_setup_matching(self, client, openreview_client, helpers):
invitation = openreview_client.get_invitation('TSACM/2024/Conference/Reviewers/-/Bid')
assert invitation.edit['tail']['param']['options']['group'] == 'TSACM/2024/Conference/Reviewers'

# assert nothing changed in Assignment_Configuration, except bid invitation was added
assignment_config_inv = pc_client_v2.get_invitation('TSACM/2024/Conference/Senior_Area_Chairs/-/Assignment_Configuration')
assert assignment_config_inv
assert 'scores_specification' in assignment_config_inv.edit['note']['content']
assert 'TSACM/2024/Conference/Senior_Area_Chairs/-/Affinity_Score' in assignment_config_inv.edit['note']['content']['scores_specification']['value']['param']['default']
assert 'TSACM/2024/Conference/Senior_Area_Chairs/-/Bid' in assignment_config_inv.edit['note']['content']['scores_specification']['value']['param']['default']
assert assignment_config_inv.edit['note']['content']['paper_invitation']['value']['param']['default'] == 'TSACM/2024/Conference/-/Submission&content.venueid=TSACM/2024/Conference/Submission'
assert conflict_invitation.id in assignment_config_inv.edit['note']['content']['conflicts_invitation']['value']['param']['default']

sac1_client = openreview.api.OpenReviewClient(username='sac@umass.edu', password=helpers.strong_password)

sac1_client.post_edge(openreview.api.Edge(invitation = venue.get_bid_id(venue.get_senior_area_chairs_id()),
Expand Down

0 comments on commit 7724f57

Please sign in to comment.