This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class memorySequence(list): | |
def __init__(self, lst, size=10): | |
super().__init__(lst) | |
self._desired_size = size | |
def append(self, item): | |
if len(self) + 1 > self._desired_size: | |
del self[0] | |
return super().append(item) | |
return super().append(item) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import matplotlib.pyplot as plt | |
from scipy.spatial import Voronoi | |
def voronoi_finite_polygons_2d(vor, radius=None): | |
""" | |
Reconstruct infinite voronoi regions in a 2D diagram to finite | |
regions. | |
Parameters |
NewerOlder