From 803f5ef7adbaf069ea07d92f6e780282d5933323 Mon Sep 17 00:00:00 2001 From: Sean MacAvaney Date: Tue, 24 Sep 2024 21:46:35 +0100 Subject: [PATCH] narrowing pt.java.required --- pyterrier/terrier/_index.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pyterrier/terrier/_index.py b/pyterrier/terrier/_index.py index 28a0c25c..8b6ae495 100644 --- a/pyterrier/terrier/_index.py +++ b/pyterrier/terrier/_index.py @@ -3,7 +3,6 @@ import pyterrier as pt -@pt.java.required class TerrierIndex(pt.Artifact): """A Terrier index.""" @@ -67,14 +66,15 @@ def bm25( def __repr__(self): return f'TerrierIndex({self.path!r})' + @pt.java.required def index_ref(self): """Returns the internal Java index reference object for this index.""" if self._index_ref is None: - self._index_ref = pt.IndexRef.of(os.path.realpath(self.path)) + self._index_ref = pt.terrier.J.IndexRef.of(os.path.realpath(self.path)) return self._index_ref def index_obj(self): """Returns the internal Java index object for this index.""" if self._index_obj is None: - self._index_obj = pt.IndexFactory.of(self.index_ref()) + self._index_obj = pt.terrier.IndexFactory.of(self.index_ref()) return self._index_obj