Commit 91299591 authored by Martin Reinecke's avatar Martin Reinecke
Browse files

port new memo handling from nightly

parent ac18a3f6
Pipeline #18989 passed with stage
in 4 minutes and 18 seconds
......@@ -66,7 +66,6 @@ class Energy(with_metaclass(NiftyMeta, type('NewBase', (object,), {}))):
def __init__(self, position):
super(Energy, self).__init__()
self._cache = {}
self._position = position.copy()
def at(self, position):
......
......@@ -18,9 +18,11 @@
def memo(f):
name = id(f)
name = f.__name__
def wrapped_f(self):
if not hasattr(self, "_cache"):
self._cache = {}
try:
return self._cache[name]
except KeyError:
......
......@@ -26,7 +26,6 @@ class LogNormalWienerFilterCurvature(InvertibleOperatorMixin,
"""
def __init__(self, R, N, S, d, position, inverter, fft4exp=None, **kwargs):
self._cache = {}
self.R = R
self.N = N
self.S = S
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment