Open antoniocarlon opened 7 years ago
I tested this together with the ACS cleanup, and found some issues:
A lot of failed tests, like:
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/nose/case.py", line 197, in runTest
self.test(*self.arg)
File "/bigmetadata/observatory-extension/src/python/test/autotest.py", line 207, in test_get_measure_areas
_test_measures(numer_ids, default_area(point))
File "/bigmetadata/observatory-extension/src/python/test/autotest.py", line 246, in _test_measures
params = OrderedDict([(p['id'], p) for p in params]).values()
TypeError: 'NoneType' object is not iterable
Very slow. This is listing all timespans and boundaries repeatedly, even when they don't match any of the given numerator ids. This is probably related with the previous error. It would be nice to do this in the first query, by grouping by numer+geom+timespan, instead of just numer.
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 check this please xD
https://github.com/CartoDB/bigmetadata/issues/325
Autotest checking against all timespans/geometry levels