malariagen / malariagen-data-python

Analyse MalariaGEN data from Python
https://malariagen.github.io/malariagen-data-python/latest/
MIT License
14 stars 24 forks source link

Fix center and zoom map parameters to allow int or float values #625

Closed leehart closed 2 months ago

leehart commented 2 months ago

Re: issue #421

leehart commented 2 months ago

CI tests failing on unrelated PCA test:

=========================== short test summary info ============================ FAILED tests/anoph/test_pca.py::test_pca_plotting[ag3_sim] - ValueError: empty range for randrange() (3, 2, -1) ============ 1 failed, 379 passed, 20 warnings in 218.40s (0:03:38) ============

leehart commented 2 months ago

Although this simple fix should work, even with type checking, after chatting we've decided that it might result in clearer docs if the data types were actually unions that allow explicitly either int or float, rather than allowing the automatic casting of int to float.

ipyleaflet's interface uses floats, but integers are generally acceptable for floats in Python, e.g. https://stackoverflow.com/questions/62725822/why-does-a-type-hint-float-accept-int-while-it-is-not-even-a-subclass