Skip to content
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

37 incidence compt #38

Merged
merged 33 commits into from
Aug 12, 2021
Merged

37 incidence compt #38

merged 33 commits into from
Aug 12, 2021

Conversation

kellypierce
Copy link
Contributor

Adding the cumulative incidence compartments to the xarray output.

@kellypierce
Copy link
Contributor Author

Currently debugging a test failure in test_bf_seir.TestBruteForceSEIR.test_can_run_step:

>           assert abs(census.sum()) <= 1e-8
E           AssertionError: assert <xarray.DataArray ()>\narray(15.) <= 1e-08
test_bf_seir.py:28: AssertionError
=========================== short test summary info ============================
FAILED test_bf_seir.py::TestBruteForceSEIR::test_can_run_step[True-0.75-realistic-24-5-10]
FAILED test_bf_seir.py::TestBruteForceSEIR::test_can_run_step[True-0.75-ones-24-3-10]
FAILED test_bf_seir.py::TestBruteForceSEIR::test_can_run_step[True-0.75-ones-24-5-10]
FAILED test_bf_seir.py::TestBruteForceSEIR::test_can_run_step[False-0.75-realistic-24-5-10]
========================= 4 failed, 4 passed in 39.02s =========================

I added some code to the test to dig into the error:

https://github.com/eho-tacc/episimlab/blob/5aac7c09233deff9bb63f92ceb3b9a36d83f65e3/tests/test_seir/test_bf_seir.py#L31

Inspection in the debugger shows that not all the population leaving S arrives in E:

<class 'dict'>: 
{'S': <xarray.DataArray ()> array(-29.)
'E': <xarray.DataArray ()>array(16.)
'Pa': <xarray.DataArray ()>array(0.)
'Py': <xarray.DataArray ()>array(0.)
'Ia': <xarray.DataArray ()>array(-132.)
'Iy': <xarray.DataArray ()>array(0.)
'Ih': <xarray.DataArray ()>array(0.)
'R': <xarray.DataArray ()>array(132.)
'D': <xarray.DataArray ()>array(0.)}

@eho-tacc any thoughts?

@ethho
Copy link
Collaborator

ethho commented Aug 11, 2021

Can reproduce on 5aac7c0 with poetry run pytest -k 'TestBruteForceSEIR' --pdb

@ethho
Copy link
Collaborator

ethho commented Aug 11, 2021

poetry run pytest tests/test_seir/test_bf_seir.py failing on 7747d4c. Passing on 41bf4e8. Addition was one critical line in the SEIR engine that we should also patch on main if necessary:

https://github.com/eho-tacc/episimlab/blob/41bf4e8e14743ad4ec321965b29a42369a2a33b1/episimlab/seir/brute_force.py#L182-L182

@ethho
Copy link
Collaborator

ethho commented Aug 11, 2021

CI fails as expected:

FAILED tests/test_seir/test_bf_cython_seir.py::TestBruteForceCythonSEIR::test_same_as_python[0.75-realistic-24-5-False]
===== 1 failed, 171 passed, 1 skipped, 2167 warnings in 146.85s (0:02:26) ======

Cython implementation does not yet have above fix implemented, but this should be quick...

@kellypierce kellypierce marked this pull request as ready for review August 11, 2021 22:11
@ethho ethho self-requested a review August 12, 2021 16:20
@kellypierce kellypierce merged commit bb56cd0 into main Aug 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants