Closed kellypierce closed 3 years ago
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:
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?
Can reproduce on 5aac7c0 with poetry run pytest -k 'TestBruteForceSEIR' --pdb
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:
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...
Adding the cumulative incidence compartments to the xarray output.