1
0
mirror of https://github.com/microsoft/qlib.git synced 2026-07-03 19:10:58 +08:00

. Revert file_storage change

This commit is contained in:
Huoran Li
2022-07-14 13:44:13 +08:00
parent 09f51061e1
commit 11ee76ed3d

View File

@@ -106,7 +106,10 @@ class FileCalendarStorage(FileStorageMixin, CalendarStorage):
if not self.uri.exists():
self._write_calendar(values=[])
with self.uri.open("rb") as fp:
return [str(x) for x in np.loadtxt(fp, str, skiprows=skip_rows, max_rows=n_rows, encoding="utf-8")]
return [
str(x)
for x in np.loadtxt(fp, str, skiprows=skip_rows, max_rows=n_rows, delimiter="\n", encoding="utf-8")
]
def _write_calendar(self, values: Iterable[CalVT], mode: str = "wb"):
with self.uri.open(mode=mode) as fp: