population_impact_phrase
site_solutions.SolutionComparator.population_impact_phrase(
matrix=None,
demand=None,
meaningful_change_threshold=0.0,
config_a=None,
config_b=None,
)Stakeholder-facing sentence summarising population_impact_summary(), e.g.:
"46,907 people (9.0% of the cohort) get a shorter journey,
averaging 16.1 minutes off. 61 of 729 regions improved; 0
worsened; 668 unchanged."
A “get a longer journey” clause is included only if people are actually worse off (demand_worsened > 0) – for the common superset comparison (adding a site while keeping every existing one), that clause would otherwise always read “0 people …, averaging nan minutes more”, which is not a sentence worth surfacing. The people-based clauses are omitted entirely if no demand data is registered (total_demand is NaN); the region-count clause always works.
When meaningful_change_threshold is greater than 0, both clauses say so explicitly (“a journey shorter by more than 5.0 minutes” rather than a bare “a shorter journey”) – a headline of “N people benefit” is only as meaningful as the change it counts, and a reader shouldn’t have to separately go and check what threshold was used to know whether “benefit” means “any improvement at all” or something larger.
When equity data is registered on the problem (add_equity_data()), two further clauses are added: the rate-normalised comparison between the most- and least-disadvantaged equity-band tertiles (per population_impact_by_equity_group() – share of EACH tertile’s own population, not share of the region-wide total), and – unconditionally, whenever it is non-zero, regardless of whether the overall worsened clause above already fired – how many people in the most disadvantaged tertile specifically saw a worse outcome. A benefits-only summary risks reading as if a candidate helps disadvantaged areas uniformly when some of them are in fact worse off; this clause is never silently dropped.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| matrix | Passed straight through to population_impact_summary(). |
None |
|
| demand | Passed straight through to population_impact_summary(). |
None |
|
| meaningful_change_threshold | Passed straight through to population_impact_summary(). |
None |
|
| config_a | Passed straight through to population_impact_summary(). |
None |
|
| config_b | Passed straight through to population_impact_summary(). |
None |
Returns
| Name | Type | Description |
|---|---|---|
| str |