Skip to content

Commit

Permalink
Merge pull request #375 from mj-will/fix-373-corner-plot-bug
Browse files Browse the repository at this point in the history
BUG: fix 373 corner plot bug
  • Loading branch information
mj-will authored Mar 11, 2024
2 parents a9c912f + d6422a3 commit b160e31
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion nessai/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -636,7 +636,7 @@ def corner_plot(
if len(labels) != unstruct_array.shape[-1]:
labels = labels[has_range]

if truths:
if truths is not None:
if isinstance(truths, dict):
if include:
truths = np.array([truths[n] for n in include])
Expand Down
2 changes: 1 addition & 1 deletion tests/test_plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,7 @@ def test_corner_plot_w_labels(live_points, labels):

@pytest.mark.parametrize(
"truths",
[[0, 0], [0, 0, None, None, None], {"x": 0, "y": 0}],
[[0, 0], [0, 0, None, None, None], {"x": 0, "y": 0}, np.array([0, 0])],
)
def test_corner_plot_w_truths(live_points, truths):
"""Test the corner plot with truths"""
Expand Down

0 comments on commit b160e31

Please sign in to comment.