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

add_pre-commit_and_flake8_to_CI

This commit is contained in:
Linlang Lv (iSoftStone)
2022-03-22 09:48:13 +08:00
committed by you-n-g
parent 243e516cf1
commit 30e457119c
45 changed files with 191 additions and 42 deletions

View File

@@ -35,3 +35,32 @@ from .cache import (
DatasetURICache,
MemoryCalendarCache,
)
__all__ = [
"D",
"CalendarProvider",
"InstrumentProvider",
"FeatureProvider",
"ExpressionProvider",
"DatasetProvider",
"LocalCalendarProvider",
"LocalInstrumentProvider",
"LocalFeatureProvider",
"LocalPITProvider",
"LocalExpressionProvider",
"LocalDatasetProvider",
"ClientCalendarProvider",
"ClientInstrumentProvider",
"ClientDatasetProvider",
"BaseProvider",
"LocalProvider",
"ClientProvider",
"ExpressionCache",
"DatasetCache",
"DiskExpressionCache",
"DiskDatasetCache",
"SimpleDatasetCache",
"DatasetURICache",
"MemoryCalendarCache",
]

View File

@@ -33,7 +33,7 @@ from ..utils import (
from ..log import get_module_logger
from .base import Feature
from .ops import Operators # pylint: disable=W0611
from .ops import Operators # pylint: disable=W0611 # noqa: F401
class QlibCacheException(RuntimeError):
@@ -528,7 +528,7 @@ class DiskExpressionCache(ExpressionCache):
CacheUtils.visit(cache_path)
series = read_bin(cache_path, start_index, end_index)
return series
except Exception as e:
except Exception:
series = None
self.logger.error("reading %s file error : %s" % (cache_path, traceback.format_exc()))
return series
@@ -1068,7 +1068,7 @@ class SimpleDatasetCache(DatasetCache):
super(SimpleDatasetCache, self).__init__(provider)
try:
self.local_cache_path: Path = Path(C["local_cache_path"]).expanduser().resolve()
except (KeyError, TypeError) as e:
except (KeyError, TypeError):
self.logger.error("Assign a local_cache_path in config if you want to use this cache mechanism")
raise
self.logger.info(

View File

@@ -38,7 +38,7 @@ from ..utils import (
get_period_list,
)
from ..utils.paral import ParallelExt
from .ops import Operators # pylint: disable=W0611
from .ops import Operators # pylint: disable=W0611 # noqa: F401
class ProviderBackendMixin:

View File

@@ -609,3 +609,6 @@ class TSDatasetH(DatasetH):
tsds = TSDataSampler(data=data, start=start, end=end, step_len=self.step_len, dtype=dtype, flt_data=flt_data)
return tsds
__all__ = ["Optional"]

View File

@@ -22,7 +22,7 @@ except ImportError:
"#### Do not import qlib package in the repository directory in case of importing qlib from . without compiling #####"
)
raise
except ValueError as e:
except ValueError:
print("!!!!!!!! A error occurs when importing operators implemented based on Cython.!!!!!!!!")
print("!!!!!!!! They will be disabled. Please Upgrade your numpy to enable them !!!!!!!!")
# We catch this error because some platform can't upgrade there package (e.g. Kaggle)

View File

@@ -2,3 +2,6 @@
# Licensed under the MIT License.
from .storage import CalendarStorage, InstrumentStorage, FeatureStorage, CalVT, InstVT, InstKT
__all__ = ["CalendarStorage", "InstrumentStorage", "FeatureStorage", "CalVT", "InstVT", "InstKT"]