From 63d05e4a1a5cde0d47071171de736df55673039e Mon Sep 17 00:00:00 2001 From: Kenneth Tang Date: Tue, 16 Feb 2021 14:08:58 +0800 Subject: [PATCH 1/3] Fix typo --- scripts/data_collector/us_index/README.md | 4 ++-- scripts/data_collector/yahoo/README.md | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/data_collector/us_index/README.md b/scripts/data_collector/us_index/README.md index 99a0a09c3..f8244491c 100644 --- a/scripts/data_collector/us_index/README.md +++ b/scripts/data_collector/us_index/README.md @@ -10,10 +10,10 @@ pip install -r requirements.txt ```bash # parse instruments, using in qlib/instruments. -python collector.py --index_name SP500 --qlib_dir ~/.qlib/qlib_data/cn_data --method parse_instruments +python collector.py --index_name SP500 --qlib_dir ~/.qlib/qlib_data/us_data --method parse_instruments # parse new companies -python collector.py --index_name SP500 --qlib_dir ~/.qlib/qlib_data/cn_data --method save_new_companies +python collector.py --index_name SP500 --qlib_dir ~/.qlib/qlib_data/us_data --method save_new_companies # index_name support: SP500, NASDAQ100, DJIA, SP400 # help diff --git a/scripts/data_collector/yahoo/README.md b/scripts/data_collector/yahoo/README.md index d4c2d2c9c..520369ef5 100644 --- a/scripts/data_collector/yahoo/README.md +++ b/scripts/data_collector/yahoo/README.md @@ -39,7 +39,7 @@ python dump_bin.py dump_all --csv_path ~/.qlib/stock_data/source/cn_1d_nor --qli import qlib from qlib.data import D -qlib.init(provider_uri="~/.qlib/stock_data/source/qlib_cn_1d", region="CN") +qlib.init(provider_uri="~/.qlib/stock_data/source/qlib_cn_1d", region="cn") df = D.features(D.instruments("all"), ["$close"], freq="day") ``` @@ -81,13 +81,13 @@ python collector.py normalize_data --source_dir ~/.qlib/stock_data/source/us_1d # dump data cd qlib/scripts -python dump_bin.py dump_all --csv_path ~/.qlib/stock_data/source/cn_1d_nor --qlib_dir ~/.qlib/stock_data/source/qlib_us_1d --freq day --exclude_fields date,adjclose,dividends,splits,symbol +python dump_bin.py dump_all --csv_path ~/.qlib/stock_data/source/us_1d_nor --qlib_dir ~/.qlib/stock_data/source/qlib_us_1d --freq day --exclude_fields date,adjclose,dividends,splits,symbol # using import qlib from qlib.data import D -qlib.init(provider_uri="~/.qlib/stock_data/source/qlib_us_1d", region="US") +qlib.init(provider_uri="~/.qlib/stock_data/source/qlib_us_1d", region="us") df = D.features(D.instruments("all"), ["$close"], freq="day") ``` From a1fb10f7cff4495d5c63a188d534a922e210e77d Mon Sep 17 00:00:00 2001 From: bxdd Date: Wed, 3 Mar 2021 00:44:52 +0900 Subject: [PATCH 2/3] update FAQ doc --- docs/FAQ/FAQ.rst | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/docs/FAQ/FAQ.rst b/docs/FAQ/FAQ.rst index ba6f77b47..df910e564 100644 --- a/docs/FAQ/FAQ.rst +++ b/docs/FAQ/FAQ.rst @@ -70,3 +70,31 @@ If the issue is not resolved, use ``keys *`` to find if multiple keys exist. If Also, feel free to post a new issue in our GitHub repository. We always check each issue carefully and try our best to solve them. + +3. ModuleNotFoundError: No module named 'qlib.data._libs.rolling' +------------------------------------------------------------------------------------------------------------------------------------ + +.. code-block:: python + + #### Do not import qlib package in the repository directory in case of importing qlib from . without compiling ##### + Traceback (most recent call last): + File "", line 1, in + File "qlib/qlib/__init__.py", line 19, in init + from .data.cache import H + File "qlib/qlib/data/__init__.py", line 8, in + from .data import ( + File "qlib/qlib/data/data.py", line 20, in + from .cache import H + File "qlib/qlib/data/cache.py", line 36, in + from .ops import Operators + File "qlib/qlib/data/ops.py", line 19, in + from ._libs.rolling import rolling_slope, rolling_rsquare, rolling_resi + ModuleNotFoundError: No module named 'qlib.data._libs.rolling' + +- If the error occurs when importing ``qlib`` package with ``PyCharm`` IDE, users can execute the following command in the project root folder to compile Cython files and generate executable files: + + .. code-block:: bash + + python setup.py build_ext --inplace + +- If the error occurs when importing ``qlib`` package with command ``python`` , users need to change the running directory to ensure that the script does not run in the project directory. \ No newline at end of file From 5378d261b41c1b104cb8a391ac29a059abee8f3f Mon Sep 17 00:00:00 2001 From: bxdd Date: Wed, 3 Mar 2021 00:47:50 +0900 Subject: [PATCH 3/3] update ops.py docstring --- qlib/data/ops.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/qlib/data/ops.py b/qlib/data/ops.py index 940c24002..94f3ff5b8 100644 --- a/qlib/data/ops.py +++ b/qlib/data/ops.py @@ -1182,7 +1182,7 @@ class Slope(Rolling): Returns ---------- Expression - a feature instance with regression slope of given window + a feature instance with linear regression slope of given window """ def __init__(self, feature, N): @@ -1210,7 +1210,7 @@ class Rsquare(Rolling): Returns ---------- Expression - a feature instance with regression r-value square of given window + a feature instance with linear regression r-value square of given window """ def __init__(self, feature, N):