Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
9a037fb
Add CI
Derek-Wds Sep 27, 2020
cd5120f
Add PEP8 style check and add bug report issue template
Derek-Wds Sep 27, 2020
fffcf9c
Add feature request issue template
Derek-Wds Sep 27, 2020
32db5d5
Update CI and add doc & question issue template
Derek-Wds Sep 28, 2020
c803b1a
Add release drafter
Derek-Wds Sep 28, 2020
600a516
Update issue template
Derek-Wds Sep 28, 2020
c34ef89
Add collect_info script
Derek-Wds Sep 28, 2020
eb044d9
Add FAQ
zhupr Sep 28, 2020
0a11de7
QLibDataHandlerClose is renamed to Alpha158
zhupr Sep 28, 2020
3b69ac3
Update FAQ
zhupr Sep 28, 2020
64b4f53
Fix test_all_pipeline.py
zhupr Sep 29, 2020
58fa002
add the badges & change setup.py version
bxdd Sep 28, 2020
d1d54ee
add long_description
bxdd Sep 28, 2020
307c78e
change the setup version
bxdd Sep 28, 2020
c4c1c8c
Create publish Action for Pypi
bxdd Sep 28, 2020
6a0fee4
update README.md
bxdd Sep 29, 2020
cabf5d4
add the cython import error log in repository directory
bxdd Sep 29, 2020
92e99f5
update installation README.md & docs
bxdd Sep 30, 2020
f54ed90
add the publishing CI for macos
bxdd Sep 30, 2020
163a5b5
Add Upload Status Badges
bxdd Sep 30, 2020
0050f46
Update Badges
bxdd Sep 30, 2020
f69cf70
Update test CI
Derek-Wds Sep 29, 2020
59012c2
Remove estimator test and Update README
Derek-Wds Sep 30, 2020
9437ecc
Fix pytest bug
Derek-Wds Sep 30, 2020
5124dcf
refactor qlib conf&init. Fix test bug
you-n-g Sep 29, 2020
a7881ad
fix bug of region
you-n-g Sep 29, 2020
2b675d0
Fix test_all_pipeline.py
zhupr Sep 30, 2020
5d55bf0
Fix tests
zhupr Sep 30, 2020
d492dde
update test
you-n-g Sep 30, 2020
79d9224
Fix C.provider_uri
zhupr Sep 30, 2020
c1a8f05
Fix test_get_data && test_dump_data
zhupr Sep 30, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions .github/ISSUE_TEMPLATE/bug-report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
name: "\U0001F41B Bug Report"
about: Submit a bug report to help us improve Qlib
labels: bug

---

## 🐛 Bug Description

<!-- A clear and concise description of what the bug is. -->

## To Reproduce

Steps to reproduce the behavior:

1.
1.
1.


## Expected Behavior

<!-- A clear and concise description of what you expected to happen. -->

## Screenshot

<!-- A screenshot of the error message or anything shouldn't appear-->

## Environment

**Note**: One could run `python scripts/collect_info.py` under the `qlib` directory to get the following information.

- Qlib version:
- Python version:
- OS (`Windows`, `Linux`, `MacOS`):
- Commit number (optional, please provide it if you are using the dev version):

## Additional Notes

<!-- Add any other information about the problem here. -->
9 changes: 9 additions & 0 deletions .github/ISSUE_TEMPLATE/documentation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
name: "\U0001F4D6 Documentation"
about: Report an issue related to documentation

---

## 📖 Documentation

<!-- Please specify whether it's tutorial part or API reference part, and describe it.-->
25 changes: 25 additions & 0 deletions .github/ISSUE_TEMPLATE/feature-request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
name: "\U0001F31FFeature Request"
about: Request for a new Qlib feature
labels: enhancement

---

## 🌟 Feature Description
<!-- A clear and concise description of the feature proposal -->

## Motivation

1. Application scenario
2. Related works (Papers, Github repos etc.):
3. Any other relevant and important information:

<!-- Please describe why the feature is important. -->

## Alternatives

<!-- A short description of any alternative solutions or features you've considered. -->

## Additional Notes

<!-- Add any other context or screenshots about the feature request here. -->
10 changes: 10 additions & 0 deletions .github/ISSUE_TEMPLATE/question.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
name: "❓Questions & Help"
about: Have some questions? We can offer help.
labels: question

---

## ❓ Questions and Help

We sincerely suggest you to carefully read the [documentation](http://qlib.readthedocs.io/) of our library as well as the official [paper](https://arxiv.org/abs/2009.11189). After that, if you still feel puzzled, please describe the question clearly under this issue.
24 changes: 24 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<!--- Provide a general summary of your changes in the Title above -->

## Description
<!--- Describe your changes in detail -->

## Motivation and Context
<!--- Are there any related issues? If so, please put the link here. -->
<!--- Why is this change required? What problem does it solve? -->

## How Has This Been Tested?
- [ ] Pass the test by running: `pytest qlib/tests/test_all_pipeline.py` under upper directory of `qlib`.
- [ ] If you are adding a new feature, test on your own test scripts.

<!--- **ATTENTION**: If you are adding a new feature, please make sure your codes are **correctly tested**. If our test scripts do not cover your cases, please provide your own test scripts under the `tests` folder and test them. More information about test scripts can be found [here](https://docs.python.org/3/library/unittest.html#basic-example), or you could refer to those we provide under the `tests` folder. -->

## Screenshots of Test Results (if appropriate):
1. Pipeline test:
2. Your own tests:

## Types of changes
<!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: -->
- [ ] Fix bugs
- [ ] Add new feature
- [ ] Update documentation
33 changes: 33 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name-template: 'v$RESOLVED_VERSION 🌈'
tag-template: 'v$RESOLVED_VERSION'
categories:
- title: '🌟 Features'
labels:
- 'feature'
- 'enhancement'
- title: '🐛 Bug Fixes'
labels:
- 'fix'
- 'bugfix'
- 'bug'
- title: '📚 Documentation'
label:
- 'doc'
- 'documentation'
change-template: '- $TITLE @$AUTHOR (#$NUMBER)'
change-title-escapes: '\<*_&' # You can add # and @ to disable mentions, and add ` to disable code blocks.
version-resolver:
major:
labels:
- 'major'
minor:
labels:
- 'minor'
patch:
labels:
- 'patch'
default: patch
template: |
## Changes

$CHANGES
61 changes: 61 additions & 0 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# This workflows will upload a Python Package using Twine when a release is created
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries

name: Upload Python Package

on:
release:
types: [created]

jobs:
deploy_with_bdist_wheel:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest, macos-latest]
python-version: [3.6, 3.7, 3.8]

steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Build wheel on Windows
run: |
pip install numpy
pip install cython
python setup.py bdist_wheel
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
twine upload dist/*

deploy_with_manylinux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Build wheel on Linux
uses: RalfG/python-wheels-manylinux-build@v0.3.1-manylinux2010_x86_64
with:
python-versions: 'cp36-cp36m cp37-cp37m cp38-cp38'
build-requirements: 'numpy cython'
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.7
- name: Install dependencies
run: |
pip install twine
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
twine upload dist/pyqlib-*-manylinux*.whl
19 changes: 19 additions & 0 deletions .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Release Drafter

on:
push:
# branches to consider in the event; optional, defaults to all
branches:
- master

jobs:
update_release_draft:
runs-on: ubuntu-latest
steps:
# Drafts your next Release notes as Pull Requests are merged into "master"
- uses: release-drafter/release-drafter@v5.11.0
with:
# (Optional) specify config name to use, relative to .github/. Default: release-drafter.yml
# config-name: my-config.yml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
60 changes: 60 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Test

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
build:

runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest, ubuntu-16.04, ubuntu-18.04, macos-latest]
python-version: [3.6, 3.7, 3.8]

steps:
- uses: actions/checkout@v2

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
pip install --upgrade cython
pip install numpy jupyter jupyter_contrib_nbextensions
python setup.py install

- name: Install Lightgbm for MacOS
if: runner.os == 'macOS'
run: |
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
brew install lightgbm

- name: Install test dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pytest

- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics

- name: Unit tests with Pytest
run: |
cd tests
pytest . --durations=0

- name: Test data downloads and examples
run: |
python scripts/get_data.py qlib_data_cn --target_dir ~/.qlib/qlib_data/cn_data
# cd examples
# estimator -c estimator/estimator_config.yaml
# jupyter nbconvert --execute estimator/analyze_from_estimator.ipynb --to html
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,5 @@ mlruns/

tags

.pytest_cache/
.vscode/
31 changes: 21 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@

[![Python Versions](https://img.shields.io/pypi/pyversions/pyqlib.svg?logo=python&logoColor=white)](https://pypi.org/project/pyqlib/#files)
[![Platform](https://img.shields.io/badge/platform-linux%20%7C%20windows%20%7C%20macos-lightgrey)](https://pypi.org/project/pyqlib/#files)
[![PypI Versions](https://img.shields.io/pypi/v/pyqlib)](https://pypi.org/project/pyqlib/#files)
[![Documentation Status](https://readthedocs.org/projects/qlib/badge/?version=latest)](https://qlib.readthedocs.io/en/latest/?badge=latest)
![Upload Python Package](https://github.com/microsoft/qlib/workflows/Upload%20Python%20Package/badge.svg)
[![License](https://img.shields.io/pypi/l/pyqlib)](LICENSE)
[![Join the chat at https://gitter.im/Microsoft/qlib](https://badges.gitter.im/Microsoft/qlib.svg)](https://gitter.im/Microsoft/qlib?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

<div style="text-align: center">
<img src="http://fintech.msra.cn/images/logo/white_bg_rec+word.png" />
</div>

<p align="center">
<img src="http://fintech.msra.cn/images/logo/1.png" />
</p>


Qlib is an AI-oriented quantitative investment platform, which aims to realize the potential, empower the research, and create the value of AI technologies in quantitative investment.
Expand Down Expand Up @@ -56,7 +62,13 @@ This quick start guide tries to demonstrate

## Installation

Users can easily intsall ``Qlib`` according to the following steps:
Users can easily install ``Qlib`` by pip according to the following command

```bash
pip install pyqlib
```

Also, Users can install ``Qlib`` by the source code according to the following steps:

* Before installing ``Qlib`` from source, users need to install some dependencies:

Expand All @@ -83,7 +95,7 @@ This dataset is created by public data collected by [crawler scripts](scripts/da
the same repository.
Users could create the same dataset with it.

*Please pay **ATTENTION** that the data is collected from [Yahoo Finance](https://finance.yahoo.com/lookup) and the data might not be perfect. We recommend users to prepare their own data if they have high-quality dataset. For more information, users can refer to the [related document](https://qlib.readthedocs.io/en/latest/component/data.html#converting-csv-format-into-qlib-format)*
*Please pay **ATTENTION** that the data is collected from [Yahoo Finance](https://finance.yahoo.com/lookup) and the data might not be perfect. We recommend users to prepare their own data if they have high-quality dataset. For more information, users can refer to the [related document](https://qlib.readthedocs.io/en/latest/component/data.html#converting-csv-format-into-qlib-format)*.

<!--
- Run the initialization code and get stock data:
Expand Down Expand Up @@ -115,7 +127,7 @@ Users could create the same dataset with it.
## Auto Quant Research Workflow
Qlib provides a tool named `Estimator` to run the whole workflow automatically (including building dataset, training models, backtest and evaluation). You can start an auto quant research workflow and have a graphical reports analysis according to the following steps:

1. Quant Research Workflow: Run `Estimator` with [estimator_config.yaml](examples/estimator/estimator_config.yaml) as following.
1. Quant Research Workflow: Run `Estimator` with [estimator_config.yaml](examples/estimator/estimator_config.yaml) as following. (*Please note that this may **not work** under MacOS with Python 3.8 due to the incompatibility of the `sacred` package we use with Python 3.8. We will fix this bug in the future.*)
```bash
cd examples # Avoid running program under the directory contains `qlib`
estimator -c estimator/estimator_config.yaml
Expand Down Expand Up @@ -154,10 +166,9 @@ Qlib provides a tool named `Estimator` to run the whole workflow automatically (
- Auto Correlation of forecasting signal (model prediction)
![Auto Correlation](http://fintech.msra.cn/images/analysis/analysis_model_auto_correlation.png?v=0.1)


- Portfolio analysis
- Backtest return
![Report](http://fintech.msra.cn/images/analysis/report.png)
![Report](http://fintech.msra.cn/images/analysis/report.png?v=0.1)
<!--
- Score IC
![Score IC](docs/_static/img/score_ic.png)
Expand All @@ -184,7 +195,7 @@ Your PR of new Quant models is highly welcomed.
# Quant Dataset Zoo
Dataset plays a very important role in Quant. Here is a list of the datasets build on `Qlib`.
- [Alpha360](./qlib/contrib/estimator/handler.py)
- [QLibDataHandlerClose](./qlib/contrib/estimator/handler.py)
- [Alpha158](./qlib/contrib/estimator/handler.py)

Here is a tutorial to build dataset with `Qlib`.
Your PR to build new Quant dataset is highly welcomed.
Expand Down
Loading