mirror of
https://github.com/microsoft/qlib.git
synced 2026-07-15 00:36:55 +08:00
Modify client-server mode and dataset-cache to disable inst_processor
This commit is contained in:
@@ -56,7 +56,8 @@ def init(default_conf="client", **kwargs):
|
|||||||
if "flask_server" in C:
|
if "flask_server" in C:
|
||||||
logger.info(f"flask_server={C['flask_server']}, flask_port={C['flask_port']}")
|
logger.info(f"flask_server={C['flask_server']}, flask_port={C['flask_port']}")
|
||||||
logger.info("qlib successfully initialized based on %s settings." % default_conf)
|
logger.info("qlib successfully initialized based on %s settings." % default_conf)
|
||||||
logger.info(f"data_path={C.dpm.provider_uri}")
|
data_path = {_freq: C.dpm.get_data_path(_freq) for _freq in C.dpm.provider_uri.keys()}
|
||||||
|
logger.info(f"data_path={data_path}")
|
||||||
|
|
||||||
|
|
||||||
def _mount_nfs_uri(provider_uri, mount_path, auto_mount: bool = False):
|
def _mount_nfs_uri(provider_uri, mount_path, auto_mount: bool = False):
|
||||||
@@ -81,7 +82,7 @@ def _mount_nfs_uri(provider_uri, mount_path, auto_mount: bool = False):
|
|||||||
exec_result = os.popen("mount -o anon %s %s" % (provider_uri, mount_path + ":"))
|
exec_result = os.popen("mount -o anon %s %s" % (provider_uri, mount_path + ":"))
|
||||||
result = exec_result.read()
|
result = exec_result.read()
|
||||||
if "85" in result:
|
if "85" in result:
|
||||||
LOG.warning("already mounted or window mount path already exists")
|
LOG.warning(f"{provider_uri} on Windows:{mount_path} is already mounted")
|
||||||
elif "53" in result:
|
elif "53" in result:
|
||||||
raise OSError("not find network path")
|
raise OSError("not find network path")
|
||||||
elif "error" in result or "错误" in result:
|
elif "error" in result or "错误" in result:
|
||||||
|
|||||||
@@ -757,7 +757,7 @@ class DiskDatasetCache(DatasetCache):
|
|||||||
LocalDatasetProvider.multi_cache_walker(instruments, fields, start_time, end_time, freq)
|
LocalDatasetProvider.multi_cache_walker(instruments, fields, start_time, end_time, freq)
|
||||||
return ""
|
return ""
|
||||||
# FIXME: The cache after resample, when read again and intercepted with end_time, results in incomplete data date
|
# FIXME: The cache after resample, when read again and intercepted with end_time, results in incomplete data date
|
||||||
if not inst_processors:
|
if inst_processors:
|
||||||
raise ValueError(
|
raise ValueError(
|
||||||
f"{self.__class__.__name__} does not support inst_processor. "
|
f"{self.__class__.__name__} does not support inst_processor. "
|
||||||
f"Please use `D.features(disk_cache=0)` or `qlib.init(dataset_cache=None)`"
|
f"Please use `D.features(disk_cache=0)` or `qlib.init(dataset_cache=None)`"
|
||||||
@@ -1139,7 +1139,7 @@ class DatasetURICache(DatasetCache):
|
|||||||
inst_processors=inst_processors,
|
inst_processors=inst_processors,
|
||||||
)
|
)
|
||||||
# FIXME: The cache after resample, when read again and intercepted with end_time, results in incomplete data date
|
# FIXME: The cache after resample, when read again and intercepted with end_time, results in incomplete data date
|
||||||
if not inst_processors:
|
if inst_processors:
|
||||||
raise ValueError(
|
raise ValueError(
|
||||||
f"{self.__class__.__name__} does not support inst_processor. "
|
f"{self.__class__.__name__} does not support inst_processor. "
|
||||||
f"Please use `D.features(disk_cache=0)` or `qlib.init(dataset_cache=None)`"
|
f"Please use `D.features(disk_cache=0)` or `qlib.init(dataset_cache=None)`"
|
||||||
|
|||||||
@@ -929,7 +929,7 @@ class ClientDatasetProvider(DatasetProvider):
|
|||||||
"""
|
"""
|
||||||
# TODO: support inst_processors, need to change the code of qlib-server at the same time
|
# TODO: support inst_processors, need to change the code of qlib-server at the same time
|
||||||
# FIXME: The cache after resample, when read again and intercepted with end_time, results in incomplete data date
|
# FIXME: The cache after resample, when read again and intercepted with end_time, results in incomplete data date
|
||||||
if not inst_processors:
|
if inst_processors:
|
||||||
raise ValueError(
|
raise ValueError(
|
||||||
f"{self.__class__.__name__} does not support inst_processor. "
|
f"{self.__class__.__name__} does not support inst_processor. "
|
||||||
f"Please use `D.features(disk_cache=0)` or `qlib.init(dataset_cache=None)`"
|
f"Please use `D.features(disk_cache=0)` or `qlib.init(dataset_cache=None)`"
|
||||||
|
|||||||
Reference in New Issue
Block a user