Skip to content

Add GenPareto and ExtGenPareto (Generalized Pareto) distributions #2692

Add GenPareto and ExtGenPareto (Generalized Pareto) distributions

Add GenPareto and ExtGenPareto (Generalized Pareto) distributions #2692

Workflow file for this run

name: pytest
on:
pull_request:
push:
branches: [main]
paths:
- ".github/workflows/*"
- "pymc_extras/**"
- "tests/**"
- "setup.py"
- "pyproject.toml"
- "conda-envs/**"
- "codecov.yml"
# Cancels all previous workflow runs for pull requests that have not completed.
concurrency:
# The concurrency group contains the workflow name and the branch name for pull requests
# or the commit hash for any other events.
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
cancel-in-progress: true
jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: "3.12"
# no-commit-to-branch fails on push to main since HEAD is main. CI lints,
# it doesn't commit, so skip that one hook.
- uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd # v3.0.1
env:
SKIP: no-commit-to-branch
ubuntu:
needs: pre-commit
strategy:
matrix:
os: [ubuntu-latest]
linker: [cvm, numba]
python-version: ["3.12"]
test-subset:
- tests/model
- tests/statespace/core/test_statespace.py
- tests/statespace/filters/test_kalman_filter.py
- tests/statespace --ignore tests/statespace/core/test_statespace.py --ignore tests/statespace/filters/test_kalman_filter.py
- tests/distributions
- tests --ignore tests/model --ignore tests/statespace --ignore tests/distributions --ignore tests/pathfinder
fail-fast: false
runs-on: ${{ matrix.os }}
env:
TEST_SUBSET: ${{ matrix.test-subset }}
PYTENSOR_FLAGS: linker=${{ matrix.linker }}
defaults:
run:
shell: bash -leo pipefail {0}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: mamba-org/setup-micromamba@d7c9bd84e824b79d2af72a2d4196c7f4300d3476 # v3.0.0
with:
environment-file: conda-envs/environment-test.yml
create-args: >-
python=${{matrix.python-version}}
environment-name: pymc-extras-test
init-shell: bash
cache-environment: true
- name: Install pymc-extras
run: |
pip install -e ".[dev]" --no-deps
python --version
pip check
- name: Run tests
run: |
python -m pytest --color=yes -vv --cov=pymc_extras --cov-append --cov-report=xml --cov-report term --durations=50 $TEST_SUBSET
- name: Upload coverage to Codecov
uses: codecov/codecov-action@57e3a136b779b570ffcdbf80b3bdc90e7fab3de2 # v6.0.0
with:
env_vars: TEST_SUBSET
name: ${{ matrix.os }}
fail_ci_if_error: false
windows:
needs: pre-commit
strategy:
matrix:
os: [windows-latest]
linker: [cvm, numba]
python-version: ["3.12"]
test-subset:
- tests/model
- tests/statespace/core/test_statespace.py
- tests/statespace/filters/test_kalman_filter.py
- tests/statespace --ignore tests/statespace/core/test_statespace.py --ignore tests/statespace/filters/test_kalman_filter.py
- tests/distributions
- tests --ignore tests/model --ignore tests/statespace --ignore tests/distributions
fail-fast: false
runs-on: ${{ matrix.os }}
env:
TEST_SUBSET: ${{ matrix.test-subset }}
PYTENSOR_FLAGS: linker=${{ matrix.linker }}
defaults:
run:
shell: cmd /C call {0}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: mamba-org/setup-micromamba@d7c9bd84e824b79d2af72a2d4196c7f4300d3476 # v3.0.0
with:
environment-file: conda-envs/environment-test.yml
# Pinned: micromamba 2.6.1-0 ships a Windows binary with a missing DLL
# dependency that breaks GitHub-hosted runners (STATUS_DLL_NOT_FOUND).
micromamba-version: "2.6.0-0"
create-args: >-
python=${{matrix.python-version}}
environment-name: pymc-extras-test
init-shell: cmd.exe
cache-environment: true
- name: Install pymc-extras
run: |
pip install -e ".[dev]" --no-deps
python --version
- name: Run tests
# This job uses a cmd shell, therefore the environment variable syntax is different!
# The ">-" in the next line replaces newlines with spaces (see https://stackoverflow.com/a/66809682).
run: >-
python -m pytest --color=yes -vv --cov=pymc_extras --cov-append --cov-report=xml --cov-report term --durations=50 %TEST_SUBSET%
- name: Upload coverage to Codecov
uses: codecov/codecov-action@57e3a136b779b570ffcdbf80b3bdc90e7fab3de2 # v6.0.0
with:
env_vars: TEST_SUBSET
name: ${{ matrix.os }}
fail_ci_if_error: false
all_tests:
if: ${{ always() }}
runs-on: ubuntu-latest
needs: [ pre-commit, ubuntu, windows ]
steps:
- name: Check all tests pass
if: ${{ needs.pre-commit.result != 'success' || needs.ubuntu.result != 'success' || needs.windows.result != 'success' }}
run: exit 1