-
Notifications
You must be signed in to change notification settings - Fork 155
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' into provide-a-devcontainer-to-be-used-in-codespace
- Loading branch information
Showing
158 changed files
with
35,112 additions
and
5,492 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
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,28 @@ | ||
# The official docs | ||
# https://docs.codecov.io/docs/codecov-yaml | ||
# https://docs.codecov.com/docs/common-recipe-list | ||
|
||
# Check if this file is valid | ||
# cd PATH_TO/sbi/.github | ||
# curl -X POST --data-binary @codecov.yml https://codecov.io/validate | ||
|
||
ignore: | ||
- "sbi/examples" | ||
|
||
coverage: | ||
status: | ||
project: | ||
default: | ||
target: 70% # the required coverage value | ||
threshold: 2% # allow the coverage to drop by X%, and posting a success status | ||
if_ci_failed: error # will set the status to success only if the CI is successful, alternative: success | ||
patch: # about the individual commit | ||
default: | ||
target: 50% # minimum coverage ratio that the commit must meet to be considered a success | ||
threshold: 2% # allow the coverage to drop by X%, and posting a success status | ||
if_ci_failed: error # will set the status to success only if the CI is successful, alternative: success | ||
|
||
comment: | ||
layout: "diff, flags, files" | ||
behavior: default # update if exists, otherwise post new | ||
require_changes: false # if true, only post the comment if coverage changes |
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,62 @@ | ||
name: Continuous Deployment | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
workflow_dispatch: | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
cd: | ||
name: CD | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
lfs: false | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.8' | ||
|
||
- name: Cache dependency | ||
id: cache-dependencies | ||
uses: actions/cache@v4 | ||
with: | ||
path: ~/.cache/pip | ||
key: ${{ runner.os }}-pip | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -e .[dev] | ||
- name: Run the fast and the slow CPU tests with coverage | ||
run: | | ||
pytest -v -x -n auto -m "not gpu" --cov=sbi --cov-report=xml tests/ | ||
- name: Upload coverage to Codecov | ||
uses: codecov/codecov-action@v4-beta | ||
with: | ||
env_vars: OS,PYTHON | ||
file: ./coverage.xml | ||
flags: unittests | ||
name: codecov-sbi-all-cpu | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
|
||
- name: Check doc building | ||
run: | | ||
jupyter nbconvert --to markdown tutorials/*.ipynb --output-dir docs/tutorial/ | ||
jupyter nbconvert --to markdown examples/*.ipynb --output-dir docs/examples/ | ||
mkdocs build -f docs/mkdocs.yml --site-dir site |
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,65 @@ | ||
name: Continuous Integration | ||
|
||
on: [pull_request, workflow_dispatch] | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
ci: | ||
name: CI | ||
runs-on: ubuntu-latest | ||
if: | | ||
github.event_name == 'push' || | ||
(github.event_name == 'pull_request' && github.event.pull_request.draft == false) | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: ['3.8'] | ||
torch-version: ['1.11', '2.2'] | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
lfs: false | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Cache dependency | ||
id: cache-dependencies | ||
uses: actions/cache@v4 | ||
with: | ||
path: ~/.cache/pip | ||
key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ matrix.torch-version }}$ | ||
restore-keys: | | ||
${{ runner.os }}-pip-${{ matrix.python-version }}- | ||
${{ runner.os }}-pip- | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install torch==${{ matrix.torch-version }} --extra-index-url https://download.pytorch.org/whl/cpu | ||
pip install -e .[dev] | ||
- name: Run the fast CPU tests with coverage | ||
run: | | ||
pytest -v -x -n auto -m "not slow and not gpu" --cov=sbi --cov-report=xml tests/ | ||
- name: Upload coverage to Codecov | ||
uses: codecov/codecov-action@v4 | ||
with: | ||
env_vars: OS,PYTHON | ||
file: ./coverage.xml | ||
flags: unittests | ||
name: codecov-sbi-fast-cpu | ||
token: ${{ secrets.CODECOV_TOKEN }} |
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,62 @@ | ||
name: Linting | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: [main] | ||
workflow_dispatch: | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
pre-commit: | ||
name: ruff and hooks. | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.8' | ||
- uses: pre-commit/[email protected] | ||
with: | ||
extra_args: --all-files --show-diff-on-failure | ||
|
||
pyright: | ||
name: Check types | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
lfs: false | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.8' | ||
|
||
- name: Cache dependency | ||
id: cache-dependencies | ||
uses: actions/cache@v4 | ||
with: | ||
path: ~/.cache/pip | ||
key: ubuntu-latest-pip-3.8 | ||
restore-keys: | | ||
ubuntu-latest-pip- | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install torch --extra-index-url https://download.pytorch.org/whl/cpu | ||
pip install -e .[dev] | ||
- name: Check types with pyright | ||
run: | | ||
pyright sbi |
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,65 @@ | ||
name: Manual-Test | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
pytest-marker: | ||
description: "Combination of markers to restrict the tests, use '' to run all tests." | ||
type: choice | ||
options: | ||
- 'not slow and not gpu' | ||
- 'not gpu' | ||
- 'not slow' | ||
- '' | ||
default: '' | ||
required: true | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
test: | ||
name: manual-test | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: ['3.8'] | ||
torch-version: ['1.11', '2.2'] | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
lfs: false | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Cache dependency | ||
id: cache-dependencies | ||
uses: actions/cache@v4 | ||
with: | ||
path: ~/.cache/pip | ||
key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ matrix.torch-version }}$ | ||
restore-keys: | | ||
${{ runner.os }}-pip-${{ matrix.python-version }}- | ||
${{ runner.os }}-pip- | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install torch==${{ matrix.torch-version }} --extra-index-url https://download.pytorch.org/whl/cpu | ||
pip install -e .[dev] | ||
- name: Run the selected tests without coverage | ||
run: | | ||
pytest -v -x -m ${{ inputs.pytest-marker }} tests/ |
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
Oops, something went wrong.