From 7ccf3f765851fecba7c410393704e7b4d7057b4e Mon Sep 17 00:00:00 2001 From: Srujan Rana <125748305+Srujanrana07@users.noreply.github.com> Date: Tue, 21 Apr 2026 11:23:18 +0530 Subject: [PATCH] fix: incorrect index implementation in FileCalendarStorage (#2195) --- qlib/data/storage/file_storage.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qlib/data/storage/file_storage.py b/qlib/data/storage/file_storage.py index 8a100a2d1..e2bc5c367 100644 --- a/qlib/data/storage/file_storage.py +++ b/qlib/data/storage/file_storage.py @@ -156,7 +156,7 @@ class FileCalendarStorage(FileStorageMixin, CalendarStorage): def index(self, value: CalVT) -> int: self.check() calendar = self._read_calendar() - return int(np.argwhere(calendar == value)[0]) + return calendar.index(value) def insert(self, index: int, value: CalVT): calendar = self._read_calendar()