Skip to content

Commit

Permalink
~~Test~~ Demo using data from WW R package (#55)
Browse files Browse the repository at this point in the history
* Adding a testing dataset from the WW repo

* Correcting how path to wastewater is retrieved

* Adding missing file (TSV wastewater)

* Adding interval datasets and starting example with ww data

* Model starts to fit but fails b/c of too big mean for negbinom [skip ci] (will fail)

* Adding math to the example-with-datasets plus clarifications in code

* Model fit runs OK (yupi)

* Adding deterministic test and fixing qmd

* Adding weekday effect to model. Still not good enough

* Rewriting downloaders to python

* Using os.path.exist

* Adding test for plot

* Updating poetry.lock

* Reference image for testing in the correct location

* Adding padding for models

* Adding padding test

* Renaming obs proc in models and working on data demo

* Adding figure of latent infections and extending padding section

* Update model/src/pyrenew/datasets/data-raw/wastewater.R

Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com>

* Update model/src/pyrenew/datasets/data-raw/wastewater.R

Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com>

* Update model/src/pyrenew/datasets/data-raw/infection_admission_interval.py

Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com>

* Typos, language, and more content to qmd doc

* Update model/src/pyrenew/datasets/data-raw/generation_interval.py

Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com>

* Fixing updates with tuple check

---------

Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com>
  • Loading branch information
gvegayon and dylanhmorris authored Apr 23, 2024
1 parent fffbee0 commit c7dc7da
Show file tree
Hide file tree
Showing 52 changed files with 2,607 additions and 358 deletions.
1 change: 1 addition & 0 deletions .github/workflows/test_model.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ jobs:
- name: run tests
run: |
poetry run -C model pytest \
--mpl --mpl-default-tolerance=10 \
--cov=pyrenew --cov-report term --cov-report xml model
- name: Upload coverage to Codecov
Expand Down
32 changes: 27 additions & 5 deletions model/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,41 @@ install:
poetry install

test:
poetry run pytest
poetry run pytest --mpl --mpl-default-tolerance=10

docs: docs/pyrenew_demo.md docs/getting-started.md
docs: docs/pyrenew_demo.md docs/getting-started.md \
docs/example-with-datasets.md

docs/pyrenew_demo.md: docs/pyrenew_demo.qmd
poetry run quarto render docs/pyrenew_demo.qmd

docs/getting-started.md: docs/getting-started.qmd
poetry run quarto render docs/getting-started.qmd

docs/example-with-datasets.md: docs/example-with-datasets.qmd
poetry run quarto render docs/example-with-datasets.qmd

docs/py: docs/notebooks
jupyter nbconvert --to python docs/pyrenew_demo.ipynb
jupyter nbconvert --to python docs/getting-started.ipynb
jupyter nbconvert --to python docs/example-with-datasets.ipynb

docs/notebooks:
quarto convert docs/pyrenew_demo.qmd --output docs/pyrenew_demo.ipynb
quarto convert docs/getting-started.qmd --output docs/getting-started.ipynb
quarto convert docs/example-with-datasets.qmd --output \
docs/example-with-datasets.ipynb

test_images:
echo "Generating reference images for tests"
poetry run pytest --mpl-generate-path=src/test/baseline

clean:
rm -rf docs/*_files/
rm -f docs/getting-started.ipynb
rm -f docs/pyrenew_demo.ipynb
for i in .py, .md, .ipynb; do \
rm -f docs/getting-started.$$i; \
rm -f docs/pyrenew_demo.$$i; \
rm -f docs/example-with-datasets.$$i; \
done

.PHONY: install test docs clean
.PHONY: install test docs clean docs/notebooks docs/py test_images
Loading

0 comments on commit c7dc7da

Please sign in to comment.