Skip to content
Snippets Groups Projects
Commit f1bb7e04 authored by Colm Talbot's avatar Colm Talbot Committed by Moritz Huebner
Browse files

Resolve "copying BBHPriorDict"

parent 92e87350
No related branches found
No related tags found
No related merge requests found
......@@ -240,6 +240,13 @@ class PriorDict(OrderedDict):
"""Empty redundancy test, should be overwritten in subclasses"""
return False
def copy(self):
"""
We have to overwrite the copy method as it fails due to the presence of
defaults.
"""
return self.__class__(dictionary=OrderedDict(self))
class PriorSet(PriorDict):
......@@ -653,7 +660,7 @@ class PowerLaw(Prior):
normalising = (1 + self.alpha) / (self.maximum ** (1 + self.alpha) -
self.minimum ** (1 + self.alpha))
return (self.alpha * np.log(val) + np.log(normalising)) + np.log(1. * self.is_in_prior_range(val))
return (self.alpha * np.nan_to_num(np.log(val)) + np.log(normalising)) + np.log(1. * self.is_in_prior_range(val))
class Uniform(Prior):
......
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