def __init__(self, degree): msg = "degree %d is outside of mesh bounds" % degree InvalidDegree.__init__(self, msg)
def unlink(self, degree, wid, border_id): if degree < 1: raise InvalidDegree("smallest wisps have no neighbors") self._borders[degree][wid].remove(border_id) self._regions[degree - 1][border_id].remove(wid)
def nb_regions(self, degree, wid): if degree >= self.degree(): raise InvalidDegree("biggest wisps do not separate regions") return len(self._regions[degree][wid])
def regions(self, degree, wid, offset=1): if (degree + offset) > self.degree(): raise InvalidDegree("biggest wisps do not separate regions") return self._regions_with_offset(degree, [wid], offset)
def nb_borders(self, degree, wid): if degree < 1: raise InvalidDegree("smallest wisps have no borders") return len(self._borders[degree][wid])
def borders(self, degree, wid, offset=1): if degree - offset < 0: raise InvalidDegree("smallest wisps have no borders") return self._borders_with_offset(degree, [wid], offset)
def __init__ (self, degree) : InvalidDegree.__init__(self,"degree %d is outside of mesh bounds" % degree)