OCHA-DAP / hdx-signals

HDX Signals
https://un-ocha-centre-for-humanitarian.gitbook.io/hdx-signals/
GNU General Public License v3.0
6 stars 0 forks source link

Improve map testing #65

Closed caldwellst closed 4 months ago

caldwellst commented 6 months ago

As a simple part of testing in #63, one thing I know we need to do is improve the map_test.R functionality to test the legend placement. The script to run the map tests for all countries is at the bottom of update_iso3_sf.R.

I thought one way could be to generate 25 random points in the adm0 shape, randomly assign them numeric values, and then size them based on those values to get the legend placed on the map, when we could then validate that we do or do not need to update the dimensions in update_iso3_map_settings.R.

zackarno commented 6 months ago

aha i had actually written some code a few days with this same thought in the ds-global-monitoring-explore repo (just pushed it) ... think basically doing what you are saying, but hadn't linked it to the parquet files, rather just using polys from rnaturalearth

https://github.com/OCHA-DAP/ds-global-monitoring-explore/blob/f8d3775a1a8dd24109543c21843f19ca27b56031/exploration/map_pts_testing.qmd#L37-L59

i had just sampled in the bbox to make it much faster as the polys are large/complex, so if we want to do this more officially where should this code be stored

caldwellst commented 6 months ago

Ah nice! We want the testing functionality in map_test.R, which is used to test that updates to the ADM0 boundaries, cities, and map settings work well. All testing should be done on the Azure files since we want to use OCHA CODs where available, and then default to other sources.

caldwellst commented 4 months ago

Closed by #75