Add limits to max/min bleed

This prevents us from giving unrealistically large or small bleed
estimates in case we have areas which are more dense or less dense than
the most/least dense areas we currently have.

Also means we don’t have to treat City of London as a special case.
This commit is contained in:
Chris Hill-Scott
2021-03-19 15:28:13 +00:00
parent 738ac1d818
commit 4367908269
3 changed files with 5 additions and 6 deletions

View File

@@ -80,9 +80,8 @@ class BroadcastArea(SortableMixin):
@property
def estimated_bleed_in_m(self):
if self.id.endswith(CITY_OF_LONDON.WARDS):
return 500
return 5_900 - (math.log(self.phone_density, 10) * 1_250)
estimated_bleed = 5_900 - (math.log(self.phone_density, 10) * 1_250)
return max(500, min(estimated_bleed, 5000))
@property
def estimated_bleed_in_degrees(self):