Skip to content
Snippets Groups Projects
Commit d34369ac authored by Colm Talbot's avatar Colm Talbot
Browse files

make test_redundancy an empty method of PriorSet

parent c57fc5ee
No related branches found
No related tags found
1 merge request!59Updating priors
......@@ -9,8 +9,6 @@ import scipy.stats
import logging
import os
from tupak.gw.prior import test_redundancy
class PriorSet(dict):
def __init__(self, dictionary=None, filename=None):
......@@ -117,11 +115,11 @@ class PriorSet(dict):
" will not be sampled and may cause an error."
.format(missing_key, set_val))
else:
if not test_redundancy(missing_key, self):
if not self.test_redundancy(missing_key):
self[missing_key] = default_prior
for key in self:
test_redundancy(key, self)
self.test_redundancy(key)
def sample(self, size=None):
"""Draw samples from the prior set"""
......@@ -136,6 +134,10 @@ class PriorSet(dict):
rescaled_sample = [self[key].rescale(sample) for key, sample in zip(keys, theta)]
return rescaled_sample
def test_redundancy(self, key):
"""Empty redundancy test, should be overwritten"""
return False
def create_default_prior(name, default_priors_file=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