Code review
Closed this issue · 3 comments
Can't do it in the usual UI as there's no pull request to reference, so here's the points I observed.
monkeypox-report/src/test_build.py
Line 105 in b09edfd
monkeypatch
to substituterequests.get
here, or any problem accessing GitHub will make the test runner exit.Line 79 in b09edfd
if __name__ == '__main__'
so that you can also test unhappy paths.monkeypox-report/src/test_build.py
Line 132 in b09edfd
n_countries_suspected_only
is 1 because it correctly counted those, not because it actually used the same logic forn_countries_discarded
? My preference would be to introduce functions that calculate the summary statistics separately and test that they work correctly, which might help with:Line 166 in b09edfd
Line 225 in b09edfd
Line 243 in b09edfd
monkeypox-report/src/test_build.py
Line 169 in b09edfd
raise ValueError
) case isn't tested.Line 268 in b09edfd
- there is a whole lot of setup code in the first 101 lines of
test_build.py
that seems to mostly generate dictionaries with random content that are used in a two-line test file. Could that be replaced with a constant dictionary, maybe loaded from json or yaml? monkeypox-report/src/figures/genomics.py
Line 30 in b09edfd
Thanks @iamleeg! Great suggestion on refactoring counts(). I will add the age upper limit, not sure how to handle the genome data, restricting it to a clade maybe a good approximation.
@abhidg also consider stating which methodology was used for genomic data in the reports containing the figures, so people know whether they can do like-for-like comparisons.
Really insightful comments. I will add the upper bound age to the figure script as well.
It would be worth discussing how to handle the genome data on tomorrow's call.