Skip to content
Snippets Groups Projects
Commit 6b64ce09 authored by Bruce Edelman's avatar Bruce Edelman
Browse files

remove redundant tuple conversions

parent d1a295c4
No related branches found
No related tags found
No related merge requests found
Pipeline #112040 failed
......@@ -380,8 +380,8 @@ class PriorDict(dict):
return all_samples
def normalize_constraint_factor(self, keys):
if tuple(keys) in self._cached_normalizations.keys():
return self._cached_normalizations[tuple(keys)]
if keys in self._cached_normalizations.keys():
return self._cached_normalizations[keys]
else:
min_accept = 1000
sampling_chunk = 5000
......@@ -398,7 +398,7 @@ class PriorDict(dict):
[all_samples[key], samples[key].flatten()])
keep = np.array(self.evaluate_constraints(all_samples), dtype=bool)
factor = len(keep) / np.count_nonzero(keep)
self._cached_normalizations[tuple(keys)] = factor
self._cached_normalizations[keys] = factor
return factor
def prob(self, sample, **kwargs):
......
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