VEuPathDB / plot.data

1 stars 0 forks source link

Map: returning extra bins #175

Closed asizemore closed 2 years ago

asizemore commented 2 years ago

Score mozambique, var= School age children treated in village (%)

Screen Shot 2022-06-13 at 4 19 07 PM

@bobular noticed that we're returning an extra bin that's empty when the map overlay var is continuous. Why does this happen?

asizemore commented 2 years ago

Ready for testing, @bobular !

bobular commented 2 years ago

Testing in the EDA...

I've corrected the number of requested bins from the client here (still to be merged) but the tests I'm reporting here are done with this correction applied.

In SCORE Mozambique some variables now return 8 bins, but a few variables return an empty 9th bin, e.g. School-age children in village count: image

Meanwhile "Total population of village" has 8 full bins :-) image

There is also a new 500 error for SCORE Moz. -> School-age children treated in village count. This doesn't go away if you do a filter on that variable (which would get rid of NAs). Mysterious!

image

bobular commented 2 years ago

Regarding the (now intermittent) extra empty bin, I looked into the code, played around with some test cases including some values that looked like School-age children in village count and its max value of 3926.4, and couldn't find any obvious explanations, and the tests all passed as expected. Maybe there's no need to add the extraBin? Or maybe we can only do that safely after we've rewritten cut()?

bobular commented 2 years ago

I am now going to try to diagnose the 500 error.

bobular commented 2 years ago

This might be it:

Error in cut.default(x, breaks, include.lowest = TRUE, right = (closed ==  : 
  'breaks' are not unique
aaronwlsong commented 2 years ago

The issue addressed in this ticket looks good now (the 9th bin (427,429]has gone), closing ticket.

BTW, the var "School-age children in village count" in this study still hits 500 error in map.

Image

Image

bobular commented 2 years ago

Yes, thanks Weilu - I am working on that now, and I made a separate ticket https://github.com/VEuPathDB/plot.data/issues/179

On Fri, Jun 17, 2022 at 7:24 PM Weilu.S @.***> wrote:

The issue addressed in this ticket looks good now, closing ticket.

BTW, the var "School-age children in village count" in this study still hits 500 error in map.

[image: Image] https://user-images.githubusercontent.com/61077845/174356050-301d3bbe-2afe-4a0a-8a5b-d69c8d756d60.png

[image: Image] https://user-images.githubusercontent.com/61077845/174356051-6a67803e-8968-4bdd-a029-1de2ff6ba720.png

— Reply to this email directly, view it on GitHub https://github.com/VEuPathDB/plot.data/issues/175#issuecomment-1159130056, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACLLHZ2FPRSPQQSIDUFETDVPS7FJANCNFSM5YVMR3CA . You are receiving this because you were mentioned.Message ID: @.***>