Roughly Equal

You can compute the population deviation for a set of districts.

def calc_population_deviation(max_pop: int, min_pop: int, target_pop: int) -> float:

where the arguments are the maxiumum, minimum, and target (average) district populations, respectively.

Examples can be found in the “population” section of the profiles in the testdata/CD116 directory.