Rework graph interfaces again

This commit is contained in:
DarkPhoenix
2019-05-17 17:48:20 +03:00
parent 512f48ebdd
commit fb5eb220fd
12 changed files with 89 additions and 183 deletions

View File

@@ -47,5 +47,19 @@ class Graph(metaclass=ABCMeta):
yield current
current += step
def clearCache(self, fitID):
self.cache.clear()
def clearCache(self, fitID=None):
if fitID is None:
self.cache.clear()
elif fitID in self.cache:
del self.cache[fitID]
class SmoothGraph(Graph, metaclass=ABCMeta):
def getPlotPoints(self, fit, extraData, xRange, xAmount):
xs = []
ys = []
for x in self._xIter(xRange, xAmount):
xs.append(x)
ys.append(self.getYForX(fit, extraData, x))
return xs, ys