diff --git a/openmmtools/cache.py b/openmmtools/cache.py index ae063a13..145072f2 100644 --- a/openmmtools/cache.py +++ b/openmmtools/cache.py @@ -143,7 +143,8 @@ def time_to_live(self, new_time_to_live): def empty(self): """Purge the cache.""" - self._data = collections.OrderedDict() + for context in list(self._data.keys()): + del self._data[context] def __getitem__(self, key): # When we access data, push element at the