Skip to content

Commit

Permalink
merge main
Browse files Browse the repository at this point in the history
  • Loading branch information
XianBW committed Aug 2, 2024
2 parents ea6ef02 + a79f9f9 commit 292deaf
Show file tree
Hide file tree
Showing 43 changed files with 1,089 additions and 566 deletions.
6 changes: 6 additions & 0 deletions .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[bumpversion]
current_version = 0.0.2
commit = True
tag = True

[bumpversion:file:pyproject.toml]
31 changes: 23 additions & 8 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,15 +1,30 @@
"""
This file is a template for the .env file.

Please copy this file to .env and fill in the values.

For more information about configuration options, please refer to the documentation

"""

# Global configs:
USE_AZURE=False
USE_AZURE_TOKEN_PROVIDER=False
MAX_RETRY=10
RETRY_WAIT_SECONDS=20

# api key
OPENAI_API_KEY=your_api_key
# LLM API Setting:
OPENAI_API_KEY=<your_api_key>
CHAT_MODEL=gpt-4-turbo
CHAT_MAX_TOKENS=3000
CHAT_TEMPERATURE=0.7
# CHAT_AZURE_API_BASE=<for_Azure_user>
# CHAT_AZURE_API_VERSION=<for_Azure_user>

# embedding model configs:
EMBEDDING_MODEL=text-embedding-3-small
# EMBEDDING_AZURE_API_BASE=<for_Azure_user>
# EMBEDDING_AZURE_API_VERSION=<for_Azure_user>

# chat model configs:
CHAT_MODEL=your_model_version
CHAT_MAX_TOKENS=3000
CHAT_TEMPERATURE=0.7
CHAT_STREAM=True
# Cache Setting (Optional):

# Senario Configs:
25 changes: 25 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<!--- Thank you for submitting a Pull Request! In order to make our work smoother, please make sure your Pull Request meets the following requirements: 1. Provide a general summary of your changes in the Title above; 2. Add appropriate prefixes to titles, such as `build:`, `chore:`, `ci:`, `deps:`, `doc:`, `docs:`, `feat:`, `fix:`, `perf:`, `ref:`, `refactor:`, `revert:`, `style:`, `test:`, `tests:`. -->

## 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?
<!--- Put an `x` in all the boxes that apply: --->
- [ ] 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
12 changes: 1 addition & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,7 @@ jobs:
python-version: ${{ matrix.python-version }}
- run: env | sort
- run: make dev
- env:
# Two environment variables here can cause sphinx to fail to build in ci.
# CHAT_MAX_TOKENS: ${{ secrets.CHAT_MAX_TOKENS }}
# CHAT_TEMPERATURE: ${{ secrets.CHAT_TEMPERATURE }}
CHAT_AZURE_API_BASE: ${{ secrets.CHAT_AZURE_API_BASE }}
CHAT_AZURE_API_VERSION: ${{ secrets.CHAT_AZURE_API_VERSION }}
CHAT_MODEL: ${{ secrets.CHAT_MODEL }}
EMBEDDING_AZURE_API_BASE: ${{ secrets.CHAT_AZURE_API_BASE }}
EMBEDDING_AZURE_API_VERSION: ${{ secrets.CHAT_AZURE_API_VERSION }}
EMBEDDING_MODEL: ${{ secrets.EMBEDDING_MODEL }}
name: lint test docs and build
- name: lint test docs and build
run: make lint docs-gen # test docs build
strategy:
matrix:
Expand Down
22 changes: 22 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
concurrency:
cancel-in-progress: true
group: ${{ github.workflow }}-${{ github.ref }}
jobs:
lint-title:
runs-on: ubuntu-latest
steps:
- name: Check PR Title for Conventional Commit Format
run: |
if ! echo "${{ github.event.pull_request.title }}" | grep -Pq '^(build|chore|ci|deps|doc|docs|feat|fix|perf|ref|refactor|revert|style|test|tests)(\(\w+\))?!?:\s.*'; then
echo 'The title does not conform to the Conventional Commit.'
echo 'Please refer to "https://www.conventionalcommits.org/"'
exit 1
fi
name: Lint pull request title
on:
pull_request:
types:
- opened
- synchronize
- reopened
- edited
130 changes: 55 additions & 75 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,15 @@
name: Release
on:
push:
branches:
- main
permissions:
contents: read
jobs:
package:
needs: release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
cache: pip
python-version: '3.8'
- run: env | sort
- run: make dev-package
- run: make build
- env:
TWINE_NON_INTERACTIVE: true
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
TWINE_USERNAME: ${{ vars.TWINE_USERNAME != '' && vars.TWINE_USERNAME || '__token__' }}
run: make upload
pages-build:
release:
permissions:
contents: write
pull-requests: read
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -27,65 +19,53 @@ jobs:
uses: actions/setup-python@v5
with:
cache: pip
python-version: '3.8'
- run: env | sort
- run: make dev-docs
- run: make docs
- name: Upload changelog
uses: actions/upload-artifact@v4
with:
name: changelog
path: docs/changelog.md
- name: Upload pages artifact
uses: actions/upload-pages-artifact@v3
with:
path: public
pages-deploy:
needs: release
permissions:
id-token: write
pages: write
runs-on: ubuntu-latest
steps:
- id: deployment
name: Deploy to GitHub Pages
uses: actions/deploy-pages@v4
release:
needs: pages-build
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install git-changelog using pipx
run: pipx install git-changelog
- name: Remove changelog to avoid file already exists error
run: rm -v docs/changelog.md
- name: Download changelog
uses: actions/download-artifact@v4
with:
name: changelog
path: docs/
python-version: '3.10'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine bump2version git-changelog # better-exceptions(optional for debug)
- name: Bump version
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
bump2version patch
NEW_VERSION=$(grep -Po '(?<=^version = ")[^"]*' pyproject.toml)
echo "new_version=$NEW_VERSION" >> $GITHUB_ENV
echo "New version: $NEW_VERSION"
- name: Push changes
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git push --follow-tags
- name: Generate changelog
run: |
make changelog
- name: Prepare release notes
run: make release-notes > release-notes.md
- id: prerelease
name: Determine prerelease
run: |
if [[ "${{ github.ref }}" =~ (a|b|rc)(0|[1-9][0-9]*)?$ ]]; then
echo "is_prerelease=true" > $GITHUB_OUTPUT
else
echo "is_prerelease=false" > $GITHUB_OUTPUT
fi
- name: Create GitHub release
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.new_version }}
release_name: Release ${{ env.new_version }}
body_path: release-notes.md
prerelease: ${{ steps.prerelease.outputs.is_prerelease }}
name: Release
on:
push:
tags:
- v?[0-9]+.[0-9]+.[0-9]+
- v?[0-9]+.[0-9]+.[0-9]+-?a[0-9]*
- v?[0-9]+.[0-9]+.[0-9]+-?b[0-9]*
- v?[0-9]+.[0-9]+.[0-9]+-?rc[0-9]*
prerelease: false
# package:
# needs: release
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# - name: Set up Python
# uses: actions/setup-python@v5
# with:
# cache: pip
# python-version: '3.10'
# - run: env | sort
# - run: make dev
# - run: make build
# - env:
# TWINE_USERNAME: __token__
# TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
# run: |
# make upload
8 changes: 7 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -169,13 +169,19 @@ docs-autobuild:
--watch rdagent

# Generate changelog from git commits.
# The -c and -s arguments should match
# If -c uses Basic (default, inherits from base class), -s optional argument: # If -c uses conventional (inherits from base class), -s optional parameter: add,fix,change,remove,merge,doc
# If -c uses conventional (inherits from base class), -s is optional: build,chore,ci,deps,doc,docs,feat,fix,perf,ref,refactor,revert,style,test,tests
# If -c uses angular (inherits from conventional), -s optional argument: build,chore,ci,deps,doc,docs,feat,fix,perf,ref,refactor,revert,style,test,tests
# NOTE(xuan.hu): Need to be run before document generation to take effect.
# $(PIPRUN) git-changelog -ETrio $(CHANGELOG_PATH) -c conventional -s build,chore,ci,docs,feat,fix,perf,refactor,revert,style,test
changelog:
@if wget -q --spider $(CHANGELOG_URL); then \
echo "Existing Changelog found at '$(CHANGELOG_URL)', download for incremental generation."; \
wget -q -O $(CHANGELOG_PATH) $(CHANGELOG_URL); \
fi
$(PIPRUN) git-changelog -ETrio $(CHANGELOG_PATH) -c conventional -s build,chore,ci,docs,feat,fix,perf,refactor,revert,style,test
$(PIPRUN) LATEST_TAG=$$(git tag --sort=-creatordate | head -n 1); \
git-changelog --bump $$LATEST_TAG -Tio docs/changelog.md -c conventional -s build,chore,ci,deps,doc,docs,feat,fix,perf,ref,refactor,revert,style,test,tests

# Generate release notes from changelog.
release-notes:
Expand Down
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,10 @@ In this project, we are aiming to build a Agent to automate Data-Driven R\&D tha
<!-- ![Data-Centric R&D Overview](docs/_static/overview.png) -->

## 📈 Scenarios/Demos
Here is our supported scenarios

In the two key areas of data-driven scenarios, model implementation and data building, our system aims to serve two main roles: 🦾copilot and 🤖agent. The 🦾copilot follows human instructions to automate repetitive tasks. The 🤖agent, being more autonomous, actively proposes ideas for better results in the future.

The supported scenarios are listed below:

| Scenario/Target | Model Implementation | Data Building |
| -- | -- | -- |
Expand Down
Loading

0 comments on commit 292deaf

Please sign in to comment.