Skip to content
Snippets Groups Projects
Commit 94cdf4ea authored by Matthew David Pitkin's avatar Matthew David Pitkin Committed by Colm Talbot
Browse files

Resolve "Ultranest breaking scheduled tests"

parent 2d991d7a
No related branches found
No related tags found
No related merge requests found
...@@ -372,20 +372,17 @@ class Ultranest(NestedSampler): ...@@ -372,20 +372,17 @@ class Ultranest(NestedSampler):
self.start_time = current_time self.start_time = current_time
def _generate_result(self, out): def _generate_result(self, out):
# extract results (samples stored in "v" will change to "points", # extract results
# weights stored in "w" will change to "weights") data = np.array(out["weighted_samples"]["points"])
datakey = "v" if "v" in out["weighted_samples"] else "points" weights = np.array(out["weighted_samples"]["weights"])
weightskey = "w" if "w" in out["weighted_samples"] else "weights"
data = np.array(out["weighted_samples"][datakey])
weights = np.array(out["weighted_samples"][weightskey])
scaledweights = weights / weights.max() scaledweights = weights / weights.max()
mask = np.random.rand(len(scaledweights)) < scaledweights mask = np.random.rand(len(scaledweights)) < scaledweights
nested_samples = DataFrame(data, columns=self.search_parameter_keys) nested_samples = DataFrame(data, columns=self.search_parameter_keys)
nested_samples["weights"] = weights nested_samples["weights"] = weights
nested_samples["log_likelihood"] = out["weighted_samples"]["L"] nested_samples["log_likelihood"] = out["weighted_samples"]["logl"]
self.result.log_likelihood_evaluations = np.array(out["weighted_samples"]["L"])[ self.result.log_likelihood_evaluations = np.array(out["weighted_samples"]["logl"])[
mask mask
] ]
self.result.sampler_output = out self.result.sampler_output = out
......
...@@ -7,4 +7,4 @@ pymc3==3.6; python_version <= '2.7' ...@@ -7,4 +7,4 @@ pymc3==3.6; python_version <= '2.7'
pymc3>=3.6; python_version > '3.4' pymc3>=3.6; python_version > '3.4'
pymultinest pymultinest
kombine kombine
ultranest ultranest>=2.2.1
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