CIF-330 [METRIC] isochrone and isodistance metrics#87
CIF-330 [METRIC] isochrone and isodistance metrics#87
Conversation
| from city_metrix.constants import GeoType, GTIFF_FILE_EXTENSION, GEOJSON_FILE_EXTENSION, NETCDF_FILE_EXTENSION, \ | ||
| CSV_FILE_EXTENSION, LOCAL_CACHE_URI, DEFAULT_PRODUCTION_ENV, CIF_CACHE_S3_BUCKET_URI, CTCM_CACHE_S3_BUCKET_URI, \ | ||
| CIF_TESTING_S3_BUCKET_URI | ||
| CIF_TESTING_S3_BUCKET_URI, FILE_KEY_ADMINBOUND_MARKER, FILE_KEY_URBEXTBOUND_MARKER |
There was a problem hiding this comment.
FILE_KEY_ADMINBOUND_MARKER and FILE_KEY_URBEXTBOUND_MARKER have not been defined in constants
There was a problem hiding this comment.
Added:
FILE_KEY_ADMINBOUND_MARKER = False FILE_KEY_URBEXTBOUND_MARKER = True
There was a problem hiding this comment.
Are we not using the CAMS GHG layer anymore? We could keep it without importing if we may need it again in the future.
There was a problem hiding this comment.
That should not be missing. I'll try to put it back in.
There was a problem hiding this comment.
Same question as above. We could keep it without importing if we may need it again in the future.
There was a problem hiding this comment.
I'll try to put this back in. Ugh.
There was a problem hiding this comment.
Same question as above. We could keep it without importing if we may need it again in the future.
tests/test_layers.py
Outdated
|
|
||
| @pytest.mark.skipif(EXECUTE_IGNORED_TESTS == False, reason="AWS redentials needed") | ||
| def test_isoline(): | ||
| layer = Isoline({'cityname': 'KEN-Nairobi', 'amenityname': 'schools', 'travelmode': 'walk', 'threshold_type': 'time', 'threshold_value': '15', 'year': 2023}) |
There was a problem hiding this comment.
Isoline() layer is not defined
There was a problem hiding this comment.
The layer is now called AccessibleRegion. Also there are Accessible Count and AccessibleCountPopWeighted. I'll have to add tests.
| project=project, worldpop_agesex_classes=WorldPopClass.ADULT, worldpop_year=worldpop_year, informal_only=False, **kwargs) | ||
|
|
||
|
|
||
| class _CountAccessiblePopWeightedChildren(_CountAccessiblePopWeighted): |
There was a problem hiding this comment.
_Children and _Elderly class is not used in the Count metrics later
There was a problem hiding this comment.
Added them. I think we're likely not to report these in the dashboard, though.
|
|
||
|
|
||
| # ************************************************ | ||
| class CountPotentialEmployers__TotalPopulationPopWeightedCount(_CountAccessiblePopWeightedAll): |
There was a problem hiding this comment.
Keep __TotalPopulationPopWeightedCount as a unit? Or __Count? Or __People?
There was a problem hiding this comment.
Let's make it __Count. I'll change them.
tests/test_metrics.py
Outdated
| assert_metric_stats(indicator, 2, 0.79, 56.29, 100, 0) | ||
|
|
||
| @pytest.mark.skipif(EXECUTE_IGNORED_TESTS == False, reason="Specific files required") | ||
| def test_children_access_open_space(): |
There was a problem hiding this comment.
Need to add more tests, at least one worldpop class per amenity.
…s-to-amenity-metric
This takes an isoline (i.e., isochrone or isodistance) geojson stored in S3 and (a) calculates percent of population (from WorldPop) that lives within the isoline and (b) calculates average number of amenity points accessible in a zone. Includes an Isoline layer and a percentpop_within_isoline metric.
https://gfw.atlassian.net/browse/CIF-330