Skip to content
Snippets Groups Projects
Commit a3d1785c authored by Gregory Ashton's avatar Gregory Ashton
Browse files

Adds unit arguments to the priors and appends them to the corner plots

Note - also forces all `__init__` calls in `prior.py` to use key word
arguments to ease changes in the future.
parent 42aa4664
No related branches found
No related tags found
No related merge requests found
Pipeline #30455 failed
......@@ -35,7 +35,7 @@ class TestPriorInstantiationWithoutOptionalPriors(unittest.TestCase):
def test_base_repr(self):
self.prior = tupak.core.prior.Prior(name='test_name', latex_label='test_label', minimum=0, maximum=1)
expected_string = "Prior(name='test_name', latex_label='test_label', minimum=0, maximum=1)"
expected_string = "Prior(name='test_name', latex_label='test_label', unit=None, minimum=0, maximum=1)"
self.assertEqual(expected_string, self.prior.__repr__())
......
This diff is collapsed.
......@@ -197,7 +197,7 @@ class Result(dict):
for k in keys:
if k in self.search_parameter_keys:
idx = self.search_parameter_keys.index(k)
latex_labels.append(self.parameter_labels[idx])
latex_labels.append(self.parameter_labels_with_unit[idx])
elif k in self.parameter_labels:
latex_labels.append(k)
else:
......
......@@ -192,6 +192,9 @@ class Sampler(object):
result.parameter_labels = [
self.priors[k].latex_label for k in
self.__search_parameter_keys]
result.parameter_labels_with_unit = [
self.priors[k].latex_label_with_unit for k in
self.__search_parameter_keys]
result.label = self.label
result.outdir = self.outdir
result.kwargs = self.kwargs
......
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