Skip to content
Snippets Groups Projects
Commit 06a6cd89 authored by Moritz Huebner's avatar Moritz Huebner
Browse files

Merge branch 'fix-cache-check-for-dictionaries' into 'master'

Improve the cache check

See merge request !1035
parents f7088b5e 18b3e164
No related branches found
No related tags found
1 merge request!1035Improve the cache check
Pipeline #311129 passed
...@@ -512,7 +512,13 @@ class Sampler(object): ...@@ -512,7 +512,13 @@ class Sampler(object):
key, self) is False: key, self) is False:
logger.debug("Cached value {} is unmatched".format(key)) logger.debug("Cached value {} is unmatched".format(key))
use_cache = False use_cache = False
if self.meta_data["likelihood"] != self.cached_result.meta_data["likelihood"]: try:
# Recursive check the dictionaries allowing for numpy arrays
np.testing.assert_equal(
self.meta_data["likelihood"],
self.cached_result.meta_data["likelihood"]
)
except AssertionError:
use_cache = False use_cache = False
if use_cache is False: if use_cache is False:
self.cached_result = None self.cached_result = None
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment