naobservatory / p2ra

4 stars 1 forks source link

Divide predictions by taxids #145

Closed jeffkaufman closed 1 year ago

jeffkaufman commented 1 year ago

When you call pathogen.estimate_incidences or pathogen.estimate_prevalences you can get estimates for a range of taxids. For example, with Norovirus you can get ones for (a) Norovirus overall, (b) Group I, and (c) Group II.

To let modeling handle each group of taxids separately, add a converter method, by_taxids, that takes a list of estimates and breaks it down by which taxids they're for.

I've updated the stats.build_model interface for this, and test_build_model and fit.py accordingly, but I haven't verified that my changes to fit.py actually work.

Separately, I ran into an issue with stats.py where a long import line was getting formatted differently between black and isort, and needed to tell isort to use black's rules.

dp-rice commented 1 year ago

Actually, just realized one thing: TestPathogensMatchStudies should check that there's data for each set of taxids, not just for each pathogen.

jeffkaufman commented 1 year ago

Actually, just realized one thing: TestPathogensMatchStudies should check that there's data for each set of taxids, not just for each pathogen.

Done in b0e0bad6b59ec756e51030293264ac8bad18f6a4