-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of https://GitHub.com/Aitomatic/OpenSSA into contrib
- Loading branch information
Showing
116 changed files
with
2,388 additions
and
396 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,8 +16,7 @@ jobs: | |
strategy: | ||
matrix: | ||
python-version: | ||
- '3.10' | ||
- 3.11 | ||
- 3.12 | ||
|
||
steps: | ||
- name: Checkout Repo | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,8 +16,7 @@ jobs: | |
strategy: | ||
matrix: | ||
python-version: | ||
- '3.10' | ||
- 3.11 | ||
- 3.12 | ||
|
||
steps: | ||
- name: Checkout Repo | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,3 +37,4 @@ docs/_build/ | |
.env | ||
tmp/ | ||
examples/data/cache/dense | ||
examples/data/*.csv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
pycodestyle: | ||
disable: | ||
- E901 # invalid syntax |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,17 +26,23 @@ ANSI_WHITE="\033[0;37m" | |
# POETRY | ||
# ====== | ||
get-poetry: | ||
python3 -m pip install Poetry --upgrade | ||
@python3 -m pip install Poetry --upgrade | ||
|
||
get-poetry-mac-sys: | ||
@python3 -m pip install Poetry --upgrade --user --break-system-packages | ||
|
||
|
||
# INSTALLATION | ||
# ============ | ||
install: | ||
poetry lock | ||
poetry install --extras=contrib --with=docs --with=lint --with=test | ||
@poetry lock | ||
@poetry install --extras=contrib --with=dev --with=docs --with=lint --with=test | ||
|
||
install-editable: | ||
python3 -m pip install -e ".[contrib]" --upgrade --user | ||
@python3 -m pip install -e ".[contrib]" --upgrade | ||
|
||
install-editable-mac-sys: | ||
@python3 -m pip install -e ".[contrib]" --upgrade --user --break-system-packages | ||
|
||
|
||
# LINTING | ||
|
@@ -46,17 +52,16 @@ lint: lint-flake8 lint-pylint lint-ruff | |
lint-flake8: | ||
# flake8.pycqa.org/en/latest/user/invocation.html | ||
# flake8.pycqa.org/en/latest/user/options.html | ||
poetry run flake8 $(LIB_DIR) $(DOCS_DIR) $(EXAMPLES_DIR) $(TESTS_DIR) \ | ||
@poetry run flake8 $(LIB_DIR) $(DOCS_DIR) $(EXAMPLES_DIR) $(TESTS_DIR) \ | ||
--verbose --color always | ||
|
||
lint-pylint: | ||
# pylint.readthedocs.io/en/latest/user_guide/usage/run.html | ||
poetry run pylint $(LIB_DIR) $(DOCS_DIR) $(EXAMPLES_DIR) $(TESTS_DIR) | ||
@poetry run pylint $(LIB_DIR) $(DOCS_DIR) $(EXAMPLES_DIR) $(TESTS_DIR) | ||
|
||
lint-ruff: | ||
# docs.astral.sh/ruff/linter | ||
poetry run ruff check $(LIB_DIR) $(DOCS_DIR) $(EXAMPLES_DIR) $(TESTS_DIR) \ | ||
--show-source \ | ||
@poetry run ruff check $(LIB_DIR) $(DOCS_DIR) $(EXAMPLES_DIR) $(TESTS_DIR) \ | ||
--output-format text \ | ||
--target-version py310 \ | ||
--preview \ | ||
|
@@ -93,17 +98,17 @@ release: build | |
# DOCUMENTATION | ||
# ============= | ||
docs: docs-build-clean docs-build-api | ||
poetry run sphinx-autobuild "$(DOCS_DIR)" "$(DOCS_BUILD_DIR)" | ||
@poetry run sphinx-autobuild "$(DOCS_DIR)" "$(DOCS_BUILD_DIR)" | ||
|
||
docs-build-clean: | ||
rm -f "$(DOCS_DIR)"/*.rst | ||
rm -rf "$(DOCS_BUILD_DIR)" | ||
@rm -f "$(DOCS_DIR)"/*.rst | ||
@rm -rf "$(DOCS_BUILD_DIR)" | ||
|
||
docs-build-api: | ||
# generate .rst files from module code & docstrings | ||
# any pathnames given at the end are paths to be excluded ignored during generation. | ||
# sphinx-doc.org/en/master/man/sphinx-apidoc.html | ||
poetry run sphinx-apidoc \ | ||
@poetry run sphinx-apidoc \ | ||
--force \ | ||
--follow-links \ | ||
--maxdepth 9 \ | ||
|
@@ -118,46 +123,46 @@ docs-build-api: | |
# rm "$(DOCS_DIR)"/*.orig | ||
|
||
docs-build: docs-build-clean docs-build-api | ||
poetry run sphinx-build "$(DOCS_DIR)" "$(DOCS_BUILD_DIR)" | ||
@poetry run sphinx-build "$(DOCS_DIR)" "$(DOCS_BUILD_DIR)" | ||
|
||
docs-deploy: docs-build | ||
git fetch --all | ||
@git fetch --all | ||
|
||
git checkout gh-pages -- | ||
@git checkout gh-pages -- | ||
|
||
git config user.email "[email protected]" | ||
git config user.name "The Vinh LUONG (LƯƠNG Thế Vinh)" | ||
@git config user.email "[email protected]" | ||
@git config user.name "The Vinh LUONG (LƯƠNG Thế Vinh)" | ||
|
||
rm *.html | ||
cp "$(DOCS_BUILD_DIR)"/*.html . | ||
git add --all "*.html" | ||
git reset "$(DOCS_DIR)/*.html" | ||
@rm *.html | ||
@cp "$(DOCS_BUILD_DIR)"/*.html . | ||
@git add --all "*.html" | ||
@git reset "$(DOCS_DIR)/*.html" | ||
|
||
for docs_subdir_to_publish in $(DOCS_SUBDIRS_TO_PUBLISH) ; do \ | ||
@for docs_subdir_to_publish in $(DOCS_SUBDIRS_TO_PUBLISH) ; do \ | ||
echo "syncing $$docs_subdir_to_publish..." ; \ | ||
rsync -av --delete --links "$(DOCS_BUILD_DIR)/$$docs_subdir_to_publish"/ $$docs_subdir_to_publish/ ; \ | ||
git add --all "$$docs_subdir_to_publish/*" ; \ | ||
done | ||
|
||
git commit -m "update GitHub Pages documentation site" | ||
git push | ||
@git commit -m "update GitHub Pages documentation site" | ||
@git push | ||
|
||
git checkout docs -- | ||
@git checkout docs -- | ||
|
||
|
||
# VERSION MANAGEMENT | ||
# ================== | ||
version: | ||
poetry version $(v) | ||
@poetry version $(v) | ||
|
||
|
||
# MISC / OTHER | ||
# ============ | ||
launch-solver: | ||
poetry run openssa launch solver | ||
@poetry run openssa launch solver | ||
|
||
public: | ||
rsync . ../openssa/ \ | ||
@rsync . ../openssa/ \ | ||
--archive \ | ||
--delete \ | ||
--exclude .git \ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
LEPTON_API_KEY=[... Lepton key (obtainable at dashboard.lepton.ai) if running on Aitomatic services ...] | ||
OPENAI_API_KEY=[... OpenAI creds if running directly on OpenAI services ...] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
LEPTON_API_KEY=[... Lepton key (obtainable at dashboard.lepton.ai) if running SSAs on Aitomatic services ...] | ||
OPENAI_API_KEY=[... OpenAI creds if running SSAs directly on OpenAI services ...] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
.data/ | ||
.streamlit/secrets.toml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
LEPTON_API_KEY = '...' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
run-streamlit: | ||
@streamlit run streamlit-main.py --server.allowRunOnSave=true --server.runOnSave=true | ||
|
||
solve: | ||
@poetry run python3 fb_ssa/prob_solve.py ${id} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<!-- markdownlint-disable MD043 --> | ||
|
||
# OpenSSA-FinanceBench benchmarking | ||
|
||
This example conducts the benchmarking of `OpenSSA` performance | ||
on the `FinanceBench` dataset. | ||
|
||
## [`FinanceBench` Dataset](https://github.com/patronus-ai/financebench/blob/main/financebench_sample_150.csv) | ||
|
||
## Running Aitomatic SSA benchmarking project | ||
|
||
Have Python 3.10-3.11 installed. | ||
|
||
Have Poetry installed: __`make get-poetry`__. | ||
|
||
__Install__ project, and update its dependencies from time to time: | ||
__`make install`__. | ||
|
||
Create `.env` file following the `.env.template` and fill in necessary credentials. | ||
|
||
__Solve__ the problem corresponding to a specific `financebench_id`: | ||
__`make solve id=...`__. | ||
|
||
- refer to `FinanceBench` dataset above for `financebench_id`s | ||
and corresponding information | ||
|
||
## Notes to Aitomatic Developers | ||
|
||
The OpenSSA dependency for this benchmarking project is from the `experimental` | ||
branch of the private [SSA](https://github.com/aitomatic/ssa) repository. | ||
Hence, all improvements to OpenSSA during this project must be | ||
committed/pushed/merged into that repository and branch. |
Oops, something went wrong.