-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rework Initial Infections and Support Exponential Growth Initializations #124
Rework Initial Infections and Support Exponential Growth Initializations #124
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #124 +/- ##
==========================================
+ Coverage 94.29% 94.81% +0.51%
==========================================
Files 37 39 +2
Lines 771 848 +77
==========================================
+ Hits 727 804 +77
Misses 44 44
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Self-reviewing to ask questions for other reviewers (or future me) to answer.
@gvegayon and I discussed all my questions over Teams. No need review the current state. |
Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com>
To regenerate the image, I did the following: cd model
poetry shell
make test_images Which runs: poetry run pytest --mpl-generate-path=src/test/baseline This is the "session info" >>> import sys
>>> import platform
on version")
print(sys.version)
print("Version info.")
print(sys.version_info)
print("\nOperating s>>> import pip
ystem")
print(platform.system(), platform.release())
print("\nInstalled packages")
pip.main(['list'])>>>
>>> print("Python version")
Python version
>>> print(sys.version)
3.10.12 (main, Nov 20 2023, 15:14:05) [GCC 11.4.0]
>>> print("Version info.")
Version info.
>>> print(sys.version_info)
sys.version_info(major=3, minor=10, micro=12, releaselevel='final', serial=0)
>>>
>>> print("\nOperating system")
Operating system
>>> print(platform.system(), platform.release())
Linux 6.5.0-35-generic
>>>
>>> print("\nInstalled packages")
Installed packages
>>> pip.main(['list'])
WARNING: pip is being invoked by an old script wrapper. This will fail in a future version of pip.
Please see https://github.com/pypa/pip/issues/5599 for advice on fixing the underlying issue.
To avoid this problem you can invoke Python with '-m pip' instead of running pip directly.
Package Version Editable project location
----------------------------- ----------- --------------------------------------------
alabaster 0.7.16
asttokens 2.4.1
attrs 23.2.0
Babel 2.15.0
certifi 2024.2.2
charset-normalizer 3.3.2
comm 0.2.2
contourpy 1.2.1
coverage 7.5.1
cycler 0.12.1
debugpy 1.8.1
decorator 5.1.1
docutils 0.21.2
exceptiongroup 1.2.1
executing 2.0.1
fastjsonschema 2.19.1
fonttools 4.51.0
idna 3.7
imagesize 1.4.1
iniconfig 2.0.0
ipykernel 6.29.4
ipython 8.24.0
jax 0.4.27
jaxlib 0.4.27
jedi 0.19.1
Jinja2 3.1.4
jsonschema 4.22.0
jsonschema-specifications 2023.12.1
jupyter_client 8.6.1
jupyter_core 5.7.2
kiwisolver 1.4.5
MarkupSafe 2.1.5
matplotlib 3.8.4
matplotlib-inline 0.1.7
ml-dtypes 0.4.0
multipledispatch 1.0.0
nbclient 0.10.0
nbformat 5.10.4
nest-asyncio 1.6.0
numpy 1.26.4
numpydoc 1.7.0
numpyro 0.13.2
opt-einsum 3.3.0
packaging 24.0
parso 0.8.4
pexpect 4.9.0
pillow 10.3.0
pip 24.0
platformdirs 4.2.1
pluggy 1.5.0
polars 0.20.25
prompt-toolkit 3.0.43
psutil 5.9.8
ptyprocess 0.7.0
pure-eval 0.2.2
Pygments 2.18.0
pyparsing 3.1.2
pyrenew 0.1.0 /home/george/Documents/development/msr/model
pytest 8.2.0
pytest-cov 5.0.0
pytest-mpl 0.17.0
python-dateutil 2.9.0.post0
PyYAML 6.0.1
pyzmq 26.0.3
referencing 0.35.1
requests 2.32.2
rpds-py 0.18.1
scipy 1.13.0
setuptools 69.1.0
six 1.16.0
snowballstemmer 2.2.0
Sphinx 7.3.7
sphinxcontrib-applehelp 1.0.8
sphinxcontrib-devhelp 1.0.6
sphinxcontrib-htmlhelp 2.0.5
sphinxcontrib-jsmath 1.0.1
sphinxcontrib-qthelp 1.0.7
sphinxcontrib-serializinghtml 1.1.10
stack-data 0.6.3
tabulate 0.9.0
tomli 2.0.1
tornado 6.4
tqdm 4.66.4
traitlets 5.14.3
typing_extensions 4.11.0
urllib3 2.2.1
wcwidth 0.2.13
0
>>> Here is the clean code: import sys
import platform
import pip
print("Python version")
print(sys.version)
print("Version info.")
print(sys.version_info)
print("\nOperating system")
print(platform.system(), platform.release())
print("\nInstalled packages")
pip.main(['list']) |
Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com>
Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com>
Closes #116.
Requesting early feedback on my very WIP changes, since this is my first contribution, and I'm pretty inexperienced at Python, object-oriented programming, and Numpyro/JAX.
Eventually, this PR will achieve several objectives:
InfectionSeedMethod
of which the current only behavior (padding with 0's) will be one method, and an exponential grown initialization will be another. Must meet all specifications documented in Exponential growth model for initial infections #116.Infections0
class to correspond to all of the "seed" infections, rather than just the initial infections (see here). This work is currently being done inmodel/src/pyrenew/latent/infection_seeding_method.py
.Much of the current PR was implemented by pattern matching existing classes and not fully understanding what I was doing. I have littered the code with questions throughout and will self-review to ask more questions.