You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
The GHSCI software is designed to be used for metropolitan areas of cities, however users could apply it for a single neighbourhood, or even a single street block.
If they did, and the population was very low, they might run into a division by zero error when a particular step in the process summarises destinations and population within grid cells.
The problematic SQL query line where this occurs is here:
This is a problem because 10,000 is treated as an integer, not a float with the result that it gets rounded to zero because the denominator is so small. The fix is simple, to amend to the following with 10000.0 instead, which evaluates the denominator as a float not an integer
t.count/a.area_sqkm/(pop_est/10000.0) AS dest_per_sqkm_per_10kpop
That should mean that regardless how low a population a study region has, as long as its greater than zero, this step will pass.
The text was updated successfully, but these errors were encountered:
…346) by creating a raster_to_db function that is now used when importing raster population grids. Also added function to drop a single table (#347), and addressed a potential division by zero error for study regions with population < 10000 (#349)
Describe the bug
The GHSCI software is designed to be used for metropolitan areas of cities, however users could apply it for a single neighbourhood, or even a single street block.
If they did, and the population was very low, they might run into a division by zero error when a particular step in the process summarises destinations and population within grid cells.
The problematic SQL query line where this occurs is here:
https://github.com/global-healthy-liveable-cities/global-indicators/blob/2ba788e601ebecbf374025986c69f9ac0ad9ea0e/process/subprocesses/_08_destination_summary.py#L45
This is a problem because 10,000 is treated as an integer, not a float with the result that it gets rounded to zero because the denominator is so small. The fix is simple, to amend to the following with 10000.0 instead, which evaluates the denominator as a float not an integer
That should mean that regardless how low a population a study region has, as long as its greater than zero, this step will pass.
The text was updated successfully, but these errors were encountered: