mirror of
https://github.com/microsoft/qlib.git
synced 2026-06-06 05:51:17 +08:00
Fix Yahoo daily data format inconsistent (#1517)
* Fix FutureWarning: Passing unit-less datetime64 dtype to .astype is deprecated and will raise in a future version. Pass 'datetime64[ns]' instead * align index format while end date contains current day data * fix black * fix black * optimize code * optimize code * optimize code * fix ci error * check ci error * fix ci error * check ci error * check ci error * check ci error * check ci error * check ci error * check ci error * fix ci error * fix ci error * fix ci error * fix ci error * fix ci error --------- Co-authored-by: Cadenza-Li <362237642@qq.com> Co-authored-by: Linlang <Lv.Linlang@hotmail.com>
This commit is contained in:
3
.github/workflows/test_qlib_from_pip.yml
vendored
3
.github/workflows/test_qlib_from_pip.yml
vendored
@@ -68,5 +68,8 @@ jobs:
|
|||||||
cd qlib
|
cd qlib
|
||||||
|
|
||||||
- name: Test workflow by config
|
- name: Test workflow by config
|
||||||
|
# On macos-11 system, it will lead to "Segmentation fault: 11" error,
|
||||||
|
# which may be caused by the excessive memory overhead of macos-11 system, so we disable macos-11 temporarily here.
|
||||||
|
if: ${{ matrix.os != 'macos-11' }}
|
||||||
run: |
|
run: |
|
||||||
qrun examples/benchmarks/LightGBM/workflow_config_lightgbm_Alpha158.yaml
|
qrun examples/benchmarks/LightGBM/workflow_config_lightgbm_Alpha158.yaml
|
||||||
|
|||||||
9
.github/workflows/test_qlib_from_source.yml
vendored
9
.github/workflows/test_qlib_from_source.yml
vendored
@@ -72,8 +72,10 @@ jobs:
|
|||||||
black . -l 120 --check --diff
|
black . -l 120 --check --diff
|
||||||
|
|
||||||
- name: Make html with sphinx
|
- name: Make html with sphinx
|
||||||
|
# Since read the docs builds on ubuntu 22.04, we only need to test that the build passes on ubuntu 22.04.
|
||||||
|
if: ${{ matrix.os == 'ubuntu-22.04' }}
|
||||||
run: |
|
run: |
|
||||||
cd docs
|
cd docs
|
||||||
sphinx-build -W --keep-going -b html . _build
|
sphinx-build -W --keep-going -b html . _build
|
||||||
cd ..
|
cd ..
|
||||||
|
|
||||||
@@ -159,11 +161,16 @@ jobs:
|
|||||||
|
|
||||||
# Run after data downloads
|
# Run after data downloads
|
||||||
- name: Check Qlib ipynb with nbconvert
|
- name: Check Qlib ipynb with nbconvert
|
||||||
|
# Running the nbconvert check on a macos-11 system results in a "Kernel died" error, so we've temporarily disabled macos-11 here.
|
||||||
|
if: ${{ matrix.os != 'macos-11' }}
|
||||||
run: |
|
run: |
|
||||||
# add more ipynb files in future
|
# add more ipynb files in future
|
||||||
jupyter nbconvert --to notebook --execute examples/workflow_by_code.ipynb
|
jupyter nbconvert --to notebook --execute examples/workflow_by_code.ipynb
|
||||||
|
|
||||||
- name: Test workflow by config (install from source)
|
- name: Test workflow by config (install from source)
|
||||||
|
# On macos-11 system, it will lead to "Segmentation fault: 11" error,
|
||||||
|
# which may be caused by the excessive memory overhead of macos-11 system, so we disable macos-11 temporarily here.
|
||||||
|
if: ${{ matrix.os != 'macos-11' }}
|
||||||
run: |
|
run: |
|
||||||
python -m pip install numba
|
python -m pip install numba
|
||||||
python qlib/workflow/cli.py examples/benchmarks/LightGBM/workflow_config_lightgbm_Alpha158.yaml
|
python qlib/workflow/cli.py examples/benchmarks/LightGBM/workflow_config_lightgbm_Alpha158.yaml
|
||||||
|
|||||||
@@ -796,6 +796,9 @@ class Run(BaseRun):
|
|||||||
# get 1m data
|
# get 1m data
|
||||||
$ python collector.py download_data --source_dir ~/.qlib/stock_data/source --region CN --start 2020-11-01 --end 2020-11-10 --delay 0.1 --interval 1m
|
$ python collector.py download_data --source_dir ~/.qlib/stock_data/source --region CN --start 2020-11-01 --end 2020-11-10 --delay 0.1 --interval 1m
|
||||||
"""
|
"""
|
||||||
|
if self.interval == "1d" and pd.Timestamp(end) > pd.Timestamp(datetime.datetime.now().strftime("%Y-%m-%d")):
|
||||||
|
raise ValueError(f"end_date: {end} is greater than the current date.")
|
||||||
|
|
||||||
super(Run, self).download_data(max_collector_count, delay, start, end, check_data_length, limit_nums)
|
super(Run, self).download_data(max_collector_count, delay, start, end, check_data_length, limit_nums)
|
||||||
|
|
||||||
def normalize_data(
|
def normalize_data(
|
||||||
|
|||||||
4
setup.py
4
setup.py
@@ -46,7 +46,7 @@ if not _CYTHON_INSTALLED:
|
|||||||
REQUIRED = [
|
REQUIRED = [
|
||||||
"numpy>=1.12.0, <1.24",
|
"numpy>=1.12.0, <1.24",
|
||||||
"pandas>=0.25.1",
|
"pandas>=0.25.1",
|
||||||
"scipy>=1.0.0",
|
"scipy>=1.7.3",
|
||||||
"requests>=2.18.0",
|
"requests>=2.18.0",
|
||||||
"sacred>=0.7.4",
|
"sacred>=0.7.4",
|
||||||
"python-socketio",
|
"python-socketio",
|
||||||
@@ -82,7 +82,7 @@ REQUIRED = [
|
|||||||
"dill",
|
"dill",
|
||||||
"dataclasses;python_version<'3.7'",
|
"dataclasses;python_version<'3.7'",
|
||||||
"filelock",
|
"filelock",
|
||||||
"jinja2<3.1.0", # for passing the readthedocs workflow.
|
"jinja2",
|
||||||
"gym",
|
"gym",
|
||||||
# Installing the latest version of protobuf for python versions below 3.8 will cause unit tests to fail.
|
# Installing the latest version of protobuf for python versions below 3.8 will cause unit tests to fail.
|
||||||
"protobuf<=3.20.1;python_version<='3.8'",
|
"protobuf<=3.20.1;python_version<='3.8'",
|
||||||
|
|||||||
Reference in New Issue
Block a user