From 5200ff520aeff6079faee7a0fa24a9217c08d806 Mon Sep 17 00:00:00 2001 From: "Linlang Lv (iSoftStone)" Date: Thu, 24 Mar 2022 22:07:30 +0800 Subject: [PATCH] fix_download_data_for_CI --- .github/workflows/test.yml | 3 ++- .github/workflows/test_macos.yml | 3 ++- qlib/backtest/signal.py | 1 - qlib/data/storage/storage.py | 8 -------- qlib/utils/index_data.py | 2 +- qlib/workflow/online/update.py | 2 -- 6 files changed, 5 insertions(+), 14 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 737a607df..4dbaf4e18 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -92,7 +92,8 @@ jobs: - name: Test data downloads run: | - python scripts/get_data.py qlib_data --target_dir ~/.qlib/qlib_data/cn_data --interval 1d --region cn + python scripts/get_data.py qlib_data --name qlib_data_simple --target_dir ~/.qlib/qlib_data/cn_data_simple --interval 1d --region cn + python -c "import os; userpath=os.path.expanduser('~'); os.rename(userpath + '/.qlib/qlib_data/cn_data_simple', userpath + '/.qlib/qlib_data/cn_data')" - name: Test workflow by config (install from pip) run: | diff --git a/.github/workflows/test_macos.yml b/.github/workflows/test_macos.yml index 2dd375122..8924fa7b2 100644 --- a/.github/workflows/test_macos.yml +++ b/.github/workflows/test_macos.yml @@ -56,7 +56,8 @@ jobs: brew install libomp.rb - name: Test data downloads run: | - python scripts/get_data.py qlib_data --target_dir ~/.qlib/qlib_data/cn_data --interval 1d --region cn + python scripts/get_data.py qlib_data --name qlib_data_simple --target_dir ~/.qlib/qlib_data/cn_data_simple --interval 1d --region cn + python -c "import os; userpath=os.path.expanduser('~'); os.rename(userpath + '/.qlib/qlib_data/cn_data_simple', userpath + '/.qlib/qlib_data/cn_data')" - name: Test workflow by config (install from pip) run: | python qlib/workflow/cli.py examples/benchmarks/LightGBM/workflow_config_lightgbm_Alpha158.yaml diff --git a/qlib/backtest/signal.py b/qlib/backtest/signal.py index a342a58be..5ff5fa945 100644 --- a/qlib/backtest/signal.py +++ b/qlib/backtest/signal.py @@ -28,7 +28,6 @@ class Signal(metaclass=abc.ABCMeta): Union[pd.Series, pd.DataFrame, None]: returns None if no signal in the specific day """ - ... class SignalWCache(Signal): diff --git a/qlib/data/storage/storage.py b/qlib/data/storage/storage.py index fd388d4ce..2eb7da1de 100644 --- a/qlib/data/storage/storage.py +++ b/qlib/data/storage/storage.py @@ -126,12 +126,10 @@ class CalendarStorage(BaseStorage): @overload def __setitem__(self, i: int, value: CalVT) -> None: """x.__setitem__(i, o) <==> (x[i] = o)""" - ... @overload def __setitem__(self, s: slice, value: Iterable[CalVT]) -> None: """x.__setitem__(s, o) <==> (x[s] = o)""" - ... def __setitem__(self, i, value) -> None: raise NotImplementedError( @@ -141,12 +139,10 @@ class CalendarStorage(BaseStorage): @overload def __delitem__(self, i: int) -> None: """x.__delitem__(i) <==> del x[i]""" - ... @overload def __delitem__(self, i: slice) -> None: """x.__delitem__(slice(start: int, stop: int, step: int)) <==> del x[start:stop:step]""" - ... def __delitem__(self, i) -> None: """ @@ -162,12 +158,10 @@ class CalendarStorage(BaseStorage): @overload def __getitem__(self, s: slice) -> Iterable[CalVT]: """x.__getitem__(slice(start: int, stop: int, step: int)) <==> x[start:stop:step]""" - ... @overload def __getitem__(self, i: int) -> CalVT: """x.__getitem__(i) <==> x[i]""" - ... def __getitem__(self, i) -> CalVT: """ @@ -467,12 +461,10 @@ class FeatureStorage(BaseStorage): ------- pd.Series(values, index=pd.RangeIndex(start, len(values)) """ - ... @overload def __getitem__(self, i: int) -> Tuple[int, float]: """x.__getitem__(y) <==> x[y]""" - ... def __getitem__(self, i) -> Union[Tuple[int, float], pd.Series]: """x.__getitem__(y) <==> x[y] diff --git a/qlib/utils/index_data.py b/qlib/utils/index_data.py index 26d59c4fe..a6320362c 100644 --- a/qlib/utils/index_data.py +++ b/qlib/utils/index_data.py @@ -62,7 +62,7 @@ def sum_by_index(data_list: Union["SingleData"], new_index: list, fill_value=0) new_index : list the new_index of new SingleData. fill_value : float - fill the missing values ​​or replace np.NaN. + fill the missing values or replace np.NaN. Returns ------- diff --git a/qlib/workflow/online/update.py b/qlib/workflow/online/update.py index d4c4df517..b5c22daed 100644 --- a/qlib/workflow/online/update.py +++ b/qlib/workflow/online/update.py @@ -77,7 +77,6 @@ class RecordUpdater(metaclass=ABCMeta): """ Update info for specific recorder """ - ... class DSBasedUpdater(RecordUpdater, metaclass=ABCMeta): @@ -248,7 +247,6 @@ class DSBasedUpdater(RecordUpdater, metaclass=ABCMeta): - `update_date` only include some data specific feature - `update` include some general routine steps(e.g. prepare dataset, checking) """ - ... def _replace_range(data, new_data):