From ab9b6dc47a9835f6ce15e08dd01cf1e303a73282 Mon Sep 17 00:00:00 2001 From: zhupr Date: Tue, 7 Sep 2021 16:03:38 +0800 Subject: [PATCH] Modify client-server mode and dataset-cache to disable inst_processor --- qlib/__init__.py | 5 +++-- qlib/data/cache.py | 4 ++-- qlib/data/data.py | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/qlib/__init__.py b/qlib/__init__.py index 347674a12..0beb8aa04 100644 --- a/qlib/__init__.py +++ b/qlib/__init__.py @@ -56,7 +56,8 @@ def init(default_conf="client", **kwargs): if "flask_server" in C: 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(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): @@ -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 + ":")) result = exec_result.read() 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: raise OSError("not find network path") elif "error" in result or "错误" in result: diff --git a/qlib/data/cache.py b/qlib/data/cache.py index 16506e0ea..ff12b504b 100644 --- a/qlib/data/cache.py +++ b/qlib/data/cache.py @@ -757,7 +757,7 @@ class DiskDatasetCache(DatasetCache): LocalDatasetProvider.multi_cache_walker(instruments, fields, start_time, end_time, freq) return "" # 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( f"{self.__class__.__name__} does not support inst_processor. " 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, ) # 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( f"{self.__class__.__name__} does not support inst_processor. " f"Please use `D.features(disk_cache=0)` or `qlib.init(dataset_cache=None)`" diff --git a/qlib/data/data.py b/qlib/data/data.py index 1830b1073..9c101c269 100644 --- a/qlib/data/data.py +++ b/qlib/data/data.py @@ -929,7 +929,7 @@ class ClientDatasetProvider(DatasetProvider): """ # 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 - if not inst_processors: + if inst_processors: raise ValueError( f"{self.__class__.__name__} does not support inst_processor. " f"Please use `D.features(disk_cache=0)` or `qlib.init(dataset_cache=None)`"