Skip to content

Introduce BetaGeoNBD Random Variable #843

Introduce BetaGeoNBD Random Variable

Introduce BetaGeoNBD Random Variable #843

Workflow file for this run

name: Test
on:
pull_request:
branches: [main]
paths:
- ".github/workflows/test.yml"
- "pyproject.toml"
- "tests/**.py"
- "pymc_marketing/**"
push:
branches: [main]
paths:
- ".github/workflows/test.yml"
- "pyproject.toml"
- "tests/**.py"
- "pymc_marketing/**"
env:
# The lower bound from the pyproject.toml file
OLDEST_PYMC_VERSION: "$(grep -E 'pymc *>' pyproject.toml | sed -n 's/.*>=\\([0-9]*\\.[0-9]*\\.[0-9]*\\).*/\\1/p')"
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
config: [ {python-version: "3.10", oldest-pymc: false}, {python-version: "3.12", oldest-pymc: true}]
split:
- "tests/mmm --ignore tests/mmm/test_tvp.py --ignore tests/mmm/test_budget_optimizer.py --ignore tests/mmm/test_hsgp.py --ignore tests/mmm/test_transformers.py"
- "tests/mmm/test_tvp.py tests/mmm/test_budget_optimizer.py tests/mmm/test_hsgp.py tests/mmm/test_transformers.py"
- "tests/clv"
- "--ignore tests/mmm --ignore tests/clv"
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.config.python-version }}
- name: Install oldest version of PyMC
if: ${{ matrix.config.oldest-pymc }}
run: pip install pymc==${{ env.OLDEST_PYMC_VERSION }}
- name: Run tests
run: |
sudo apt-get install graphviz
pip install -e .[test]
pytest ${{ matrix.split }}
- name: Check oldest version of PyMC
if: ${{ matrix.config.oldest-pymc }}
run: python -c "import pymc; assert pymc.__version__ == '${{ env.OLDEST_PYMC_VERSION }}'"
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }} # use token for more robust uploads
name: ${{ matrix.config.python-version }}
fail_ci_if_error: false
test_slow:
runs-on: ubuntu-latest
strategy:
matrix:
# From referencing https://github.com/pymc-labs/pymc-marketing/issues/1158
split:
- "tests/clv/models/test_beta_geo_beta_binom.py"
- "tests/clv/models/test_pareto_nbd.py"
- "--ignore tests/clv/models/test_beta_geo_beta_binom.py --ignore tests/clv/models/test_pareto_nbd.py"
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Run tests
run: |
pip install -e .[test]
pytest --only-slow ${{ matrix.split }}
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }} # use token for more robust uploads
name: "test_slow"
fail_ci_if_error: false