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

Merge branch 'fix-ultranest-tests' into 'master'

Resolve "Ultranest breaking scheduled tests"

Closes #493

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