From 59410e810a1e93f096103c79bad9fc02362f071a Mon Sep 17 00:00:00 2001 From: Ferdinand Schlatt Date: Wed, 23 Sep 2026 15:45:19 +0200 Subject: [PATCH] Avoid numba recompilation for varying document-id lengths MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `Run`/`Qrels` store document ids as a fixed-width unicode numpy array whose dtype (` --- ranx/data_structures/qrels.py | 3 ++- ranx/data_structures/run.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ranx/data_structures/qrels.py b/ranx/data_structures/qrels.py index f0d24bf..4ad6ada 100644 --- a/ranx/data_structures/qrels.py +++ b/ranx/data_structures/qrels.py @@ -74,7 +74,8 @@ def __init__(self, qrels: Dict[str, Dict[str, int]] = None, name: str = None): # Doc IDs doc_ids = [list(doc.keys()) for doc in qrels.values()] max_len = max(len(y) for x in doc_ids for y in x) - dtype = f" 1 else 1 + dtype = f" 1 else 1 + dtype = f"