CartoDB / observatory-extension

BSD 3-Clause "New" or "Revised" License
6 stars 4 forks source link

Autotest checking against all timespans/geometry levels #312

Open antoniocarlon opened 7 years ago

antoniocarlon commented 7 years ago

https://github.com/CartoDB/bigmetadata/issues/325

Autotest checking against all timespans/geometry levels

javitonino commented 7 years ago

I tested this together with the ACS cleanup, and found some issues:

javitonino commented 7 years ago

This is failing in the following assert: https://github.com/CartoDB/observatory-extension/blob/39b88feabdde5221fd451437d79d5b4d8a1b2f18/src/python/test/autotest.py#L230-L232

I did some triage, and it is because the selection of test points. All tests against school district geometries must use the different test point. That means that test point selection should be made based on geometry id (not numer id).

So, I hacked this, and it starts failing in a different, more interesting way (an actual bug detected by the tests). Basically, PUMA 2010 is not compatible at all with PUMA 2015. So, what happens, is that a lot of those fail (and some other geos as well). The geo lookup is done using the 2015 geographies, but the geoids are not the same as in the 2010 census.

For example, GetData for {'numer_timespan': '2006 - 2010', 'geom_id': 'us.census.tiger.puma', 'normalization': 'predenominated', 'numer_id': 'us.census.acs.B01001002'} at st_setsrid(st_makepoint(-81.3544048197256,28.3305906291771),4326) fails. Some debugging shows that the PUMA id corresponding to that location is 1209702. There is no data for that ID in 2010.

So we should start thinking about loading geographies for different years and properly matching them before this.

javitonino commented 7 years ago

Blocked by https://github.com/CartoDB/bigmetadata/issues/351

ethervoid commented 6 years ago

@javitonino check this please xD