Precinct Documentation

Precinct

Precinct defines a precinct and it’s immutable data.

class distopia.precinct.Precinct(boundary=None, identity=0, name='', location=0, 0, **kwargs)[source]

Describes a precinct and its data.

boundary = []

A nx2 list of the x, y coordinates of the polygon that describes the precinct’s boundary.

district = None

The District that currently contains this precinct.

identity = 0

The id of the precinct.

location = (0, 0)

The (practically unique) center location of the precinct.

metrics = {}

A mapping from name to the PrecinctMetric instance that contains the metric data for this precinct.

name = ''

Name describing the precinct.

neighbours = []

List of other Precinct’s that are on the boundary of this precinct.

Precinct Metrics

Defines metrics that are specific to Precincts.

class distopia.precinct.metrics.PrecinctMetric(name, scalar_value=0, scalar_maximum=0, scalar_label='', **kwargs)[source]

Metrics used with distopia.precinct.Precinct.

name = ''

A globally unique metric name that describes the metric.

class distopia.precinct.metrics.PrecinctHistogram(data, labels, **kwargs)[source]