Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion src/coauthor_counts.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,23 @@ def fetch_profile(client, tilde_id):
return profiles[0] if profiles else None


def get_all_notes_paged(client, **params):
"""Drop-in for client.get_all_notes().

get_all_notes() probes the total via a with_count=True request and crashes
(KeyError: 'count') when the server response carries no 'count' field
(observed with openreview-py 1.27.3 against api2, 2026-08). Plain offset
pagination needs no count.
"""
notes, offset, limit = [], 0, 1000
while True:
batch = client.get_notes(offset=offset, limit=limit, **params)
notes.extend(batch)
if len(batch) < limit:
return notes
offset += limit


def main():
# --- 1. Log in -------------------------------------------------------------
login_email = input("OpenReview login email: ").strip()
Expand Down Expand Up @@ -141,7 +158,7 @@ def main():
# (permission-aware); keep the TMLR submissions. get_all_notes() paginates.
tmlr_notes = {}
for tilde_id in my_tilde_ids:
for note in client.get_all_notes(content={"authorids": tilde_id}):
for note in get_all_notes_paged(client, content={"authorids": tilde_id}):
if any(inv.startswith(TMLR_SUBMISSION_INVITATION)
for inv in note_invitations(note)):
tmlr_notes[note.id] = note
Expand Down