-
Notifications
You must be signed in to change notification settings - Fork 656
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
83 changed files
with
2,040 additions
and
1,513 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -1,7 +1,6 @@ | ||
# this is example of the file that can be used for storing private and user specific environment variables, like keys or system paths | ||
# create a file named .env (by default .env will be excluded from version control) | ||
# the variables declared in .env are loaded in train.py automatically | ||
# example of file for storing private and user specific environment variables, like keys or system paths | ||
# rename it to ".env" (excluded from version control by default) | ||
# .env is loaded by train.py automatically | ||
# hydra allows you to reference variables in .yaml configs with special syntax: ${oc.env:MY_VAR} | ||
|
||
MY_VAR="/home/user/my/system/path" | ||
MY_KEY="asdgjhawi8y23ihsghsueity23ihwd" |
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,22 @@ | ||
## What does this PR do? | ||
|
||
<!-- | ||
Please include a summary of the change and which issue is fixed. | ||
Please also include relevant motivation and context. | ||
List any dependencies that are required for this change. | ||
List all the breaking changes introduced by this pull request. | ||
--> | ||
|
||
Fixes #\<issue_number> | ||
|
||
## Before submitting | ||
|
||
- [ ] Did you make sure **title is self-explanatory** and **the description concisely explains the PR**? | ||
- [ ] Did you make sure your **PR does only one thing**, instead of bundling different changes together? | ||
- [ ] Did you list all the **breaking changes** introduced by this pull request? | ||
- [ ] Did you **test your PR locally** with `pytest` command? | ||
- [ ] Did you **run pre-commit hooks** with `pre-commit run -a` command? | ||
|
||
## Did you have fun? | ||
|
||
Make sure you had fun coding 🙃 |
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,11 @@ | ||
# To get started with Dependabot version updates, you'll need to specify which | ||
# package ecosystems to update and where the package manifests are located. | ||
# Please see the documentation for all configuration options: | ||
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates | ||
|
||
version: 2 | ||
updates: | ||
- package-ecosystem: "pip" # See documentation for possible values | ||
directory: "/" # Location of package manifests | ||
schedule: | ||
interval: "daily" |
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,22 @@ | ||
# Same as `code-quality-pr.yaml` but triggered on commit to main branch | ||
# and runs on all files (instead of only the changed ones) | ||
|
||
name: Code Quality On Push | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
|
||
jobs: | ||
code-quality: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
|
||
- name: Run pre-commits | ||
uses: pre-commit/action@v2.0.3 |
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,36 @@ | ||
# This workflow finds which files were changed, prints them, | ||
# and runs `pre-commit` on those files. | ||
|
||
# Inspired by the sktime library: | ||
# https://github.com/alan-turing-institute/sktime/blob/main/.github/workflows/test.yml | ||
|
||
name: Code Quality On PR | ||
|
||
on: | ||
pull_request: | ||
branches: [main, "release/*"] | ||
|
||
jobs: | ||
code-quality: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
|
||
- name: Find modified files | ||
id: file_changes | ||
uses: trilom/file-changes-action@v1.2.4 | ||
with: | ||
output: " " | ||
|
||
- name: List modified files | ||
run: echo '${{ steps.file_changes.outputs.files}}' | ||
|
||
- name: Run pre-commits | ||
uses: pre-commit/action@v2.0.3 | ||
with: | ||
extra_args: --files ${{ steps.file_changes.outputs.files}} |
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,70 @@ | ||
name: Tests | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
branches: [main, "release/*"] | ||
|
||
jobs: | ||
run_tests: | ||
runs-on: ${{ matrix.os }} | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: ["ubuntu-latest", "macos-latest", "windows-latest"] | ||
python-version: ["3.7", "3.8", "3.9", "3.10"] | ||
|
||
timeout-minutes: 10 | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -r requirements.txt | ||
pip install pytest | ||
pip install protobuf==3.20.0 | ||
- name: List dependencies | ||
run: | | ||
python -m pip list | ||
- name: Run pytest | ||
run: | | ||
pytest -v | ||
# upload code coverage report | ||
code-coverage: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Python 3.10 | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: "3.10" | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -r requirements.txt | ||
pip install pytest | ||
pip install pytest-cov[toml] | ||
pip install protobuf==3.20.0 | ||
- name: Run tests and collect coverage | ||
run: pytest --cov src # NEEDS TO BE UPDATED WHEN CHANGING THE NAME OF "src" FOLDER | ||
|
||
- name: Upload coverage to Codecov | ||
uses: codecov/codecov-action@v3 |
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,42 @@ | ||
|
||
help: ## Show help | ||
@grep -E '^[.a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' | ||
|
||
clean: ## Clean autogenerated files | ||
rm -rf dist | ||
find . -type f -name "*.DS_Store" -ls -delete | ||
find . | grep -E "(__pycache__|\.pyc|\.pyo)" | xargs rm -rf | ||
find . | grep -E ".pytest_cache" | xargs rm -rf | ||
find . | grep -E ".ipynb_checkpoints" | xargs rm -rf | ||
rm -f .coverage | ||
|
||
clean-logs: ## Clean logs | ||
rm -r logs/** | ||
|
||
style: ## Run pre-commit hooks | ||
pre-commit run -a | ||
|
||
sync: ## Merge changes from main branch to your current branch | ||
git fetch --all | ||
git merge main | ||
|
||
test: ## Run not slow tests | ||
pytest -k "not slow" | ||
|
||
test-full: ## Run all tests | ||
pytest | ||
|
||
train: ## Train the model | ||
python src/train.py | ||
|
||
debug: ## Enter debugging mode with pdb | ||
# | ||
# tips: | ||
# - use "import pdb; pdb.set_trace()" to set breakpoint | ||
# - use "h" to print all commands | ||
# - use "n" to execute the next line | ||
# - use "c" to run until the breakpoint is hit | ||
# - use "l" to print src code around current line, "ll" for full function code | ||
# - docs: https://docs.python.org/3/library/pdb.html | ||
# | ||
python -m pdb src/train.py debug=default |
Oops, something went wrong.