metawards.WardID

class metawards.WardID(home: Optional[Union[metawards._wardid.WardID, str, int]] = None, commute: Optional[Union[metawards._wardid.WardID, str, int]] = None, all_commute: bool = False)[source]

A simple class that identifies a Ward (or Wards), or a connection between Wards. This could be used, e.g. to specify ward moves

__init__(home: Optional[Union[metawards._wardid.WardID, str, int]] = None, commute: Optional[Union[metawards._wardid.WardID, str, int]] = None, all_commute: bool = False)[source]

Construct a WardID that identifies the ‘home’ ward, and (optionally) the ‘commute’ ward if this is a ward-link (used to identify workers)

If “all_commute” is true then this identifies all connections that have ‘home’ as the home ward.

Methods

__delattr__(name, /)

Implement delattr(self, name).

__dir__()

Default dir() implementation.

__eq__(other)

Return self==value.

__format__(format_spec, /)

Default object formatter.

__ge__(value, /)

Return self>=value.

__getattribute__(name, /)

Return getattr(self, name).

__gt__(value, /)

Return self>value.

__init__([home, commute, all_commute])

Construct a WardID that identifies the 'home' ward, and (optionally) the 'commute' ward if this is a ward-link (used to identify workers)

__init_subclass__

This method is called when a class is subclassed.

__le__(value, /)

Return self<=value.

__lt__(value, /)

Return self<value.

__ne__(value, /)

Return self!=value.

__new__(**kwargs)

__reduce__()

Helper for pickle.

__reduce_ex__(protocol, /)

Helper for pickle.

__repr__()

Return repr(self).

__setattr__(name, value, /)

Implement setattr(self, name, value).

__sizeof__()

Size of object in memory, in bytes.

__str__()

Return str(self).

__subclasshook__

Abstract classes can override this to customize issubclass().

commute()

Return the commute ward is this is a ward connection

home()

Return the home ward

is_all_commute()

Return whether or not this refers to all commuter connections to a ward

is_null()

Return whether or not this is null

is_ward()

Return whether or not this specifies a single ward

is_ward_connection()

Return whether or not this is a ward connection (has both a home and commute ward)

Attributes

__dict__

__doc__

__hash__

__module__

__weakref__

list of weak references to the object (if defined)

__eq__(other)[source]

Return self==value.

__hash__ = None
__init__(home: Optional[Union[metawards._wardid.WardID, str, int]] = None, commute: Optional[Union[metawards._wardid.WardID, str, int]] = None, all_commute: bool = False)[source]

Construct a WardID that identifies the ‘home’ ward, and (optionally) the ‘commute’ ward if this is a ward-link (used to identify workers)

If “all_commute” is true then this identifies all connections that have ‘home’ as the home ward.

__repr__()[source]

Return repr(self).

__str__()[source]

Return str(self).

commute()[source]

Return the commute ward is this is a ward connection

home()[source]

Return the home ward

is_all_commute()[source]

Return whether or not this refers to all commuter connections to a ward

is_null()[source]

Return whether or not this is null

is_ward()[source]

Return whether or not this specifies a single ward

is_ward_connection()[source]

Return whether or not this is a ward connection (has both a home and commute ward)