Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
79 commits
Select commit Hold shift + click to select a range
4904212
Add `gempyor.distributions` module
TimothyWillard Jun 2, 2025
3413d85
Add `UniformDistribution`
TimothyWillard Jun 2, 2025
33bc456
Add `PoissonDistribution`
TimothyWillard Jun 2, 2025
bf06e4a
Add `BinomialDistribution`
TimothyWillard Jun 2, 2025
44d02c5
Add `LognormalDistribution`
TimothyWillard Jun 2, 2025
1ebc8ac
Add `TruncatedNormalDistribution`
TimothyWillard Jun 2, 2025
d573954
Add GammaDistribution
emprzy Jun 20, 2025
0ce1aa0
Add `WeibullDistribution`
emprzy Jun 20, 2025
5658993
Add tests for `NormalDistribution`
emprzy Jun 20, 2025
65093e3
Add tests for `FixedDistribution`
emprzy Jun 20, 2025
c530c97
Add tests for `UniformDistribution`
emprzy Jun 20, 2025
dd21f04
Add tests for `LognormalDistribution`
emprzy Jun 20, 2025
0f0c8eb
Add tests for `TruncatedNormalDistribution`
emprzy Jun 23, 2025
fa71562
Add tests for `PoissonDistribution`
emprzy Jun 23, 2025
bc1edee
Reformatting with `black`
emprzy Jun 23, 2025
48c3481
Add tests for `BinomialDistribution`
emprzy Jun 23, 2025
ed2e81d
Add tests for `GammaDistribution`
emprzy Jun 23, 2025
e660b0d
Add tests for `WeibullDistribution`
emprzy Jun 23, 2025
8c6ad61
Update flepimop/gempyor_pkg/src/gempyor/distributions.py
emprzy Jun 23, 2025
5829da1
Rename test files and update a docstring in `distributions.py`
emprzy Jun 24, 2025
ffb1d3c
Update flepimop/gempyor_pkg/src/gempyor/distributions.py
emprzy Jun 25, 2025
346d7e1
Re-implement recent changes after force push by @TimothyWillard
emprzy Jul 2, 2025
febe7cb
Split `gempyor` test suite into slow and not slow tests
emprzy Jul 9, 2025
bb68fce
Add `test_npis::test_spatial_groups()` to slow test group to resolve …
emprzy Jul 9, 2025
be0664a
Add second `test_spatial_groups()` test to slow group
emprzy Jul 9, 2025
2e22442
Change "slow" test group (fast group takes ~1/7 of total time)
emprzy Jul 9, 2025
365e196
Remove unecessary `time` command in `gempyor CI`.
emprzy Jul 10, 2025
8f7daf8
Refactor tests for new ABC `rng` property.
emprzy Jul 11, 2025
3b75ca5
Reduce chance transient sampling error in `test_distributions_abc.py`
emprzy Jul 11, 2025
711d25f
Apply suggestions from code review
pearsonca Jul 14, 2025
f5a0892
Merge pull request #580 from HopkinsIDD/feature/522/split-test-suite
emprzy Jul 14, 2025
69756eb
Abstract shape tests into `test_distributions_common.py`
emprzy Jul 14, 2025
1e32b6d
Typo fix and additional bounds test for `TruncatedNormalDistribution`
emprzy Jul 15, 2025
d5a5e98
Build parameter `allow_edge_cases: bool = False` to distribution classes
emprzy Jul 15, 2025
8185916
Apply suggestions from @TimothyWillard 's review
emprzy Jul 16, 2025
921f41a
Change `Field` constraints for `BinomialDistribution`
emprzy Jul 17, 2025
d038d78
Merge pull request #575 from HopkinsIDD/gempyor-distributions
emprzy Jul 17, 2025
6036cf3
Incorporate `gempyor.distributions` into `gempyor.parameters`
emprzy Jul 17, 2025
536e847
Update `Parameters` class testing
emprzy Jul 18, 2025
89453b2
Fix bugs created in last push
emprzy Jul 18, 2025
0c74575
Remove unnecessary assertions in `test_parameters_class.py`
emprzy Jul 18, 2025
bf1fc2d
Fix `UnboundLocalError` error in `onerun_SEIR`
TimothyWillard Jul 22, 2025
113a8bb
Update flepimop/gempyor_pkg/tests/parameters/test_parameters_class.py
emprzy Jul 24, 2025
8edee45
Update flepimop/gempyor_pkg/src/gempyor/_pydantic_ext.py
emprzy Jul 24, 2025
8d66efa
Improvements surrounding new `_evaled_expression()` function
emprzy Jul 24, 2025
29240a7
Introduce a `_evaled_expression_int()` function
emprzy Jul 24, 2025
16a90aa
Outsource distribution construction to `distributions.py`
emprzy Jul 24, 2025
9470e32
Combine `_pydantic_ext` expression evaluation functions, de-duplicate…
emprzy Jul 25, 2025
7f35376
Fix tests
emprzy Jul 25, 2025
6e4e39c
Remove accidental file duplicate
emprzy Jul 25, 2025
f33aa8b
Refactoring all uses of `.as_random_distribution` to `build_distribut…
emprzy Jul 28, 2025
45f857f
Refactoring all uses of `.as_random_distribution` to `build_distribut…
emprzy Jul 28, 2025
1cb847d
Merge branch 'incorporate-gem.distributions-into-gem.parameters' of h…
emprzy Jul 28, 2025
3dccedb
De-duplicate code by removing three four functions from `gempyor.utils`
emprzy Jul 29, 2025
51ec305
Update flepimop/gempyor_pkg/src/gempyor/_pydantic_ext.py
emprzy Jul 29, 2025
e5f3220
Remove `*` keyword arg for `target_type` in `_evaled_expression()`
emprzy Jul 29, 2025
88640bb
Update flepimop/gempyor_pkg/src/gempyor/_pydantic_ext.py
emprzy Jul 29, 2025
da53ac7
Merge branch 'incorporate-gem.distributions-into-gem.parameters' of h…
emprzy Jul 29, 2025
89f960b
Update flepimop/gempyor_pkg/src/gempyor/_pydantic_ext.py
emprzy Jul 29, 2025
00fd9f7
Merge branch 'incorporate-gem.distributions-into-gem.parameters' of h…
emprzy Jul 29, 2025
1172363
Naming suggestions, deleting duplication
emprzy Jul 29, 2025
606cb4c
Implement review suggestions
emprzy Jul 29, 2025
549b6c5
Update flepimop/gempyor_pkg/src/gempyor/NPI/SinglePeriodModifier.py
emprzy Jul 29, 2025
260dcb2
Update flepimop/gempyor_pkg/src/gempyor/parameters.py
emprzy Jul 29, 2025
9a2daea
Update parameters.py
emprzy Jul 29, 2025
379bc9b
Merge pull request #584 from HopkinsIDD/incorporate-gem.distributions…
emprzy Jul 29, 2025
b24e9a3
add vectorization expeirments to dev
jc-macdonald Jul 30, 2025
9fc2b6a
Revert "add vectorization expeirments to dev"
jc-macdonald Jul 30, 2025
1c03702
Pull flepiMoP install info out of install
TimothyWillard Jul 17, 2025
82f82f7
Use conda and install scripts in CI workflows
TimothyWillard Jul 17, 2025
1c0eff2
Update `environment.yml` via GitHub action
TimothyWillard Jul 17, 2025
b0825df
Add doctests to gempyor CI
TimothyWillard Jul 17, 2025
641b6a1
Improve `environment.yml` file formatting
TimothyWillard Jul 22, 2025
6dc69f4
Update `environment.yml` via GitHub action
TimothyWillard Jul 22, 2025
ce89427
Remove push to `dev` trigger, split out slow tests
TimothyWillard Jul 31, 2025
fda910d
Extract out R pkg installer
TimothyWillard Jul 31, 2025
17565d5
Adjustment for `gempyor.seir.write_seir` args
TimothyWillard Jul 25, 2025
43a6d4b
Remove spuriously committed jupyter notebook
TimothyWillard Aug 6, 2025
4e0e96b
Allow explicit 0 mobility
TimothyWillard Aug 19, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions .github/actions/flepimop-install/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: flepiMoP Install
description: Install flepiMoP and its dependencies
inputs:
python-version:
description: Python version to use
required: true
default: "3.11"
R-version:
description: R version to use
required: true
default: "4.3"
runs:
using: "composite"
steps:
- name: Install system dependencies
run: |
sudo apt update
sudo apt install \
libcurl4-openssl-dev \
libharfbuzz-dev \
libfribidi-dev \
libtiff5-dev \
libudunits2-dev \
libgdal-dev \
libgeos-dev \
libproj-dev \
libfontconfig1-dev \
pandoc
shell: bash
- name: Setup miniconda
uses: conda-incubator/setup-miniconda@v3
with:
auto-update-conda: true
- name: Conda venv cache
id: conda-venv-cache
uses: actions/cache@v4
with:
key: flepimop-conda-${{ runner.os }}-${{ inputs.R-version }}-${{ inputs.python-version }}-${{ hashFiles('flepimop/R_packages/flepicommon/DESCRIPTION', 'flepimop/R_packages/flepicommon/NAMESPACE', 'flepimop/R_packages/flepiconfig/DESCRIPTION', 'flepimop/R_packages/flepiconfig/NAMESPACE', 'flepimop/R_packages/inference/DESCRIPTION', 'flepimop/R_packages/inference/NAMESPACE', 'flepimop/gempyor_pkg/pyproject.toml', 'environment.yml') }}
path: './venv'
- name: Install flepiMoP
if: steps.conda-venv-cache.outputs.cache-hit != 'true'
run: |
rm -rf venv/
sed -i 's/^- python.*$/- python=${{ inputs.python-version}}/g' environment.yml
sed -i 's/^- r-base.*$/- r-base=${{ inputs.R-version}}/g' environment.yml
./bin/flepimop-install-dev
shell: bash -el {0}
- name: flepiMoP install info
run: |
conda activate venv/
export FLEPI_PATH=$(pwd)
./bin/flepimop-install-info
shell: bash -el {0}
6 changes: 0 additions & 6 deletions .github/workflows/conda-env.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,6 @@ name: Generate Conda Environment

on:
workflow_dispatch:
push:
paths:
- build/create_environment_yml.R
- flepimop/R_packages/*/DESCRIPTION
branches:
- dev
pull_request:
types:
- edited
Expand Down
71 changes: 13 additions & 58 deletions .github/workflows/flepicommon-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@ name: flepicommon CI

on:
workflow_dispatch:
push:
paths:
- flepimop/R_packages/flepicommon/**/*
branches:
- dev
pull_request:
types:
- edited
Expand All @@ -26,66 +21,26 @@ jobs:
if: github.event_name != 'pull_request' || github.event.pull_request.draft == false
strategy:
matrix:
R-version: ["4.3.3"]
python-version: ["3.11"]
R-version: ["4.3"]
steps:
- name: Checkout
- name: Checkout flepiMoP
uses: actions/checkout@v4
with:
lfs: true
sparse-checkout: |
*
!documentation/
sparse-checkout-cone-mode: false
- name: Setup R
uses: r-lib/actions/setup-r@v2
persist-credentials: false
- name: Install flepiMoP
uses: ./.github/actions/flepimop-install
with:
r-version: ${{ matrix.R-version }}
update-rtools: true
- name: Install System Dependencies
run: sudo apt install libcurl4-openssl-dev libharfbuzz-dev libfribidi-dev libtiff5-dev libudunits2-dev libgdal-dev libgeos-dev libproj-dev libfontconfig1-dev
- name: Determine R Library Location
run: |
R_LIBPATH=$( R -s -e "cat(.libPaths()[1L])" | xargs )
echo "R_LIBPATH=$R_LIBPATH" >> $GITHUB_ENV
R_LIBPATH_CKSUM=$( echo "$R_LIBPATH" | cksum | cut -d ' ' -f 1 )
echo "R_LIBPATH_CKSUM=$R_LIBPATH_CKSUM" >> $GITHUB_ENV
CACHE_DATE=$( date -d "last Sunday" +%Y%m%d )
echo "CACHE_DATE=$CACHE_DATE" >> $GITHUB_ENV
- name: R Library Cache
uses: actions/cache@v4
with:
key: flepicommon-rlibs-${{ runner.os }}-${{ matrix.R-version }}-${{ hashFiles('flepimop/R_packages/flepicommon/DESCRIPTION', 'flepimop/R_packages/flepicommon/NAMESPACE') }}-${{ env.R_LIBPATH_CKSUM }}-${{ env.CACHE_DATE }}
path: ${{ env.R_LIBPATH }}
restore-keys: |
flepicommon-rlibs-${{ runner.os }}-${{ matrix.R-version }}-${{ hashFiles('flepimop/R_packages/flepicommon/DESCRIPTION', 'flepimop/R_packages/flepicommon/NAMESPACE') }}-${{ env.R_LIBPATH_CKSUM }}-
flepicommon-rlibs-${{ runner.os }}-${{ matrix.R-version }}-${{ hashFiles('flepimop/R_packages/flepicommon/DESCRIPTION', 'flepimop/R_packages/flepicommon/NAMESPACE') }}-
flepicommon-rlibs-${{ runner.os }}-${{ matrix.R-version }}-
- name: Install R Dependencies
if: steps.r-library-cache.outputs.cache-hit != 'true'
run: |
install.packages(
"devtools",
repos = "https://cloud.r-project.org",
)
library(devtools)
devtools::install_deps(
pkg = "flepimop/R_packages/flepicommon",
dependencies = TRUE
)
install.packages("epidatr", repos = "https://cloud.r-project.org")
shell: Rscript {0}
- name: Install The flepicommon Package
run: |
devtools::install(
pkg = "flepimop/R_packages/flepicommon",
args = c(getOption("devtools.install.args"), "--install-tests"),
quick = TRUE,
dependencies = TRUE,
force = TRUE
)
shell: Rscript {0}
- name: Run Tests
python-version: ${{ matrix.python-version }}
R-version: ${{ matrix.R-version }}
- name: Run tests
run: |
library(testthat)
test_package("flepicommon")
shell: Rscript {0}
conda activate venv/
export FLEPI_PATH=$(pwd)
Rscript -e "library(testthat); test_package('flepicommon')"
shell: bash -el {0}
99 changes: 66 additions & 33 deletions .github/workflows/gempyor-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,6 @@ name: gempyor CI

on:
workflow_dispatch:
push:
paths:
- examples/**/*
- flepimop/gempyor_pkg/**/*
branches:
- dev
pull_request:
types:
- edited
Expand All @@ -23,76 +17,115 @@ on:
- main

jobs:
tests:
fast-tests:
runs-on: ubuntu-latest
if: github.event_name != 'pull_request' || github.event.pull_request.draft == false
strategy:
matrix:
python-version: ["3.10", "3.11"]
R-version: ["4.3"]
steps:
- name: Checkout
- name: Checkout flepiMoP
uses: actions/checkout@v4
with:
lfs: true
sparse-checkout: |
*
!documentation/
sparse-checkout-cone-mode: false
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
persist-credentials: false
- name: Install flepiMoP
uses: ./.github/actions/flepimop-install
with:
python-version: ${{ matrix.python-version }}
- name: Install gempyor
R-version: ${{ matrix.R-version }}
- name: Run doctests
run: |
python -m pip install --upgrade pip
python -m pip install "flepimop/gempyor_pkg[dev]"
shell: bash
- name: Run gempyor tests
conda activate venv/
export FLEPI_PATH=$(pwd)
cd flepimop/gempyor_pkg
pytest --doctest-modules --exitfirst src/gempyor/
shell: bash -el {0}
- name: Run fast unit tests
run: |
conda activate venv/
export FLEPI_PATH=$(pwd)
cd flepimop/gempyor_pkg
pytest --exitfirst
shell: bash
pytest -m "not slow" --exitfirst
shell: bash -el {0}
- name: Run gempyor-cli integration tests from examples
run: |
conda activate venv/
cd examples
pytest --exitfirst
shell: bash
doc-updates:
shell: bash -el {0}
slow-tests:
needs: fast-tests
runs-on: ubuntu-latest
if: github.event_name != 'pull_request' || github.event.pull_request.draft == false
strategy:
matrix:
python-version: ["3.11"]
R-version: ["4.3"]
steps:
- name: Checkout
- name: Checkout flepiMoP
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref || github.ref }}
lfs: true
sparse-checkout: |
*
!tests/
!documentation/
sparse-checkout-cone-mode: false
- name: Setup Python 3.11
uses: actions/setup-python@v5
persist-credentials: false
- name: Install flepiMoP
uses: ./.github/actions/flepimop-install
with:
python-version: '3.11'
- name: Install gempyor
python-version: ${{ matrix.python-version }}
R-version: ${{ matrix.R-version }}
- name: Run slow unit tests
run: |
python -m pip install --upgrade pip
python -m pip install "flepimop/gempyor_pkg[dev]"
shell: bash
conda activate venv/
export FLEPI_PATH=$(pwd)
cd flepimop/gempyor_pkg
pytest -m "slow"
shell: bash -el {0}
doc-updates:
runs-on: ubuntu-latest
if: github.event_name != 'pull_request' || github.event.pull_request.draft == false
strategy:
matrix:
python-version: ["3.11"]
R-version: ["4.3"]
steps:
- name: Checkout flepiMoP
uses: actions/checkout@v4
with:
lfs: true
sparse-checkout: |
*
!documentation/
sparse-checkout-cone-mode: false
persist-credentials: false
- name: Install flepiMoP
uses: ./.github/actions/flepimop-install
with:
python-version: ${{ matrix.python-version }}
R-version: ${{ matrix.R-version }}
- name: Build gempyor documentation with Sphinx
run: |
conda activate venv/
export FLEPI_PATH=$(pwd)
cd flepimop/gempyor_pkg/docs
make fullbuild
shell: bash
- name: Install pandoc
run: |
sudo apt-get update && sudo apt-get install -y pandoc
shell: bash -el {0}
- name: Build click documentation with click-man
run: |
conda activate venv/
export FLEPI_PATH=$(pwd)
cd flepimop/gempyor_pkg
click-man flepimop --target docs/cli_man --man-version 1
python docs/click-man_parsing.py
shell: bash -el {0}
- name: Remove temporal metadata from man page headers
run: |
sed -i 's/^\(\.TH [^"]* \)"[^"]*" "\(.*\)"/\1"" "\2"/' flepimop/gempyor_pkg/docs/cli_man/*.1
Expand Down
Loading
Loading