utilities.normalise_region_weights()

Turn user-supplied regional weights into shares ordered by region_names.

Usage

utilities.normalise_region_weights(
    region_weights,
    region_names,
)

Parameters

region_weights: dict[str, float]

Weight for each region, e.g. its share (or level) of national output. Need not sum to one.

region_names: list[str]

Region names in model order.

Raises

ValueError

If the keys do not match region_names exactly, or if any weight is not a positive, finite number.

Returns

npt.NDArray[np.float64]

npt.NDArray[np.float64]: Shares, shape (R,), summing to one.