Skip to content
Snippets Groups Projects
Commit cd59aab3 authored by Matthew Pitkin's avatar Matthew Pitkin
Browse files

prior.py: do not need to add new sample method

parent 254481f4
No related branches found
No related tags found
1 merge request!139Add PyMC3 sampler
......@@ -634,16 +634,6 @@ class Uniform(Prior):
"""
Prior.__init__(self, name, latex_label, minimum, maximum, use_pymc3)
def sample(self, size=None):
if self.use_pymc3:
try:
import pymc3
return pymc3.Uniform.dist(lower=self.minimum, upper=self.maximum).random(size=size)
except ImportError:
raise ImportError("Could not import PyMC3")
else:
return self.rescale(np.random.uniform(0., 1., size=size))
def rescale(self, val):
Prior.test_valid_for_rescaling(val)
return self.minimum + val * (self.maximum - self.minimum)
......
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