From 7724f571760b1ecbebdc5f2fb173bcf6f36e9233 Mon Sep 17 00:00:00 2001 From: celestemartinez <32438984+celestemartinez@users.noreply.github.com> Date: Thu, 25 Apr 2024 13:28:21 -0400 Subject: [PATCH] Venue: add bid invitation to assignment configuration (#2111) * add bid invitation tp assignment configuration * save scores spec in bid invitation --------- Co-authored-by: Melisa Bok --- openreview/venue/invitation.py | 34 +++++++++++++++++++++++++++++++- openreview/venue/matching.py | 12 +---------- tests/test_sac_paper_matching.py | 9 +++++++++ 3 files changed, 43 insertions(+), 12 deletions(-) diff --git a/openreview/venue/invitation.py b/openreview/venue/invitation.py index da57462c5..9eaf9badc 100644 --- a/openreview/venue/invitation.py +++ b/openreview/venue/invitation.py @@ -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' @@ -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': { @@ -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 diff --git a/openreview/venue/matching.py b/openreview/venue/matching.py index 7d5b10868..bf6c4216a 100644 --- a/openreview/venue/matching.py +++ b/openreview/venue/matching.py @@ -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: diff --git a/tests/test_sac_paper_matching.py b/tests/test_sac_paper_matching.py index c20eaf204..69a807a2c 100644 --- a/tests/test_sac_paper_matching.py +++ b/tests/test_sac_paper_matching.py @@ -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()),