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

Adjust rolling api (#1594)

* Intermediate version

* Fix yaml template & Successfully run rolling

* Be compatible with benchmark

* Get same results with previous linear model

* Black formatting

* Update black

* Update the placeholder mechanism

* Update CI

* Update CI

* Upgrade Black

* Fix CI and simplify code

* Fix CI

* Move the data processing caching mechanism into utils.

* Adjusting DDG-DA

* Organize import
This commit is contained in:
you-n-g
2023-07-14 12:16:12 +08:00
committed by GitHub
parent 8d3adf34ac
commit be4646b4b7
148 changed files with 1035 additions and 1028 deletions

View File

@@ -583,7 +583,6 @@ class DiskExpressionCache(ExpressionCache):
r.tofile(str(cache_path))
def update(self, sid, cache_uri, freq: str = "day"):
cp_cache_uri = self.get_cache_dir(freq).joinpath(sid).joinpath(cache_uri)
meta_path = cp_cache_uri.with_suffix(".meta")
if not self.check_cache_exists(cp_cache_uri, suffix_list=[".meta"]):
@@ -696,7 +695,6 @@ class DiskDatasetCache(DatasetCache):
def _dataset(
self, instruments, fields, start_time=None, end_time=None, freq="day", disk_cache=0, inst_processors=[]
):
if disk_cache == 0:
# In this case, data_set cache is configured but will not be used.
return self.provider.dataset(
@@ -801,7 +799,6 @@ class DiskDatasetCache(DatasetCache):
KEY = "df"
def __init__(self, cache_path: Union[str, Path]):
self.index_path = cache_path.with_suffix(".index")
self._data = None
self.logger = get_module_logger(self.__class__.__name__)
@@ -1126,7 +1123,6 @@ class DatasetURICache(DatasetCache):
def dataset(
self, instruments, fields, start_time=None, end_time=None, freq="day", disk_cache=0, inst_processors=[]
):
if "local" in C.dataset_provider.lower():
# use LocalDatasetProvider
return self.provider.dataset(
@@ -1189,7 +1185,6 @@ class MemoryCalendarCache(CalendarCache):
uri = self._uri(start_time, end_time, freq, future)
result, expire = MemCacheExpire.get_cache(H["c"], uri)
if result is None or expire:
result = self.provider.calendar(start_time, end_time, freq, future)
MemCacheExpire.set_cache(H["c"], uri, result)