$ python -m pytest tests/test_plot.py -x
======================================== test session starts =========================================
platform linux -- Python 3.11.3, pytest-7.3.0, pluggy-1.0.0
rootdir: /home/duncan/git/nessai
configfile: pyproject.toml
plugins: cov-4.0.0
collected 75 items
tests/test_plot.py .......................................................F
============================================== FAILURES ==============================================
__________________________________________ test_corner_plot __________________________________________
live_points = array([(-4.65345777, 0.96432746, nan, nan, 0),
(-2.21440385, 4.9681729 , nan, nan, 0),
( 1.67006296, ... -3.00372179, nan, nan, 0)],
dtype=[('x', '<f8'), ('y', '<f8'), ('logP', '<f8'), ('logL', '<f8'), ('it', '<i4')])
def test_corner_plot(live_points):
"""Test the corner plot."""
> fig = plot.corner_plot(live_points)
tests/test_plot.py:446:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
nessai/plot.py:58: in wrapper
return func(*args, **kwargs)
nessai/plot.py:634: in corner_plot
fig = corner.corner(
../../opt/mambaforge/envs/nessai/lib/python3.11/site-packages/corner/corner.py:280: in corner
return arviz_corner(
../../opt/mambaforge/envs/nessai/lib/python3.11/site-packages/corner/arviz_corner.py:136: in arviz_corner
fig = corner_impl(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
xs = array([[-4.65345777, 0.96432746],
[-2.21440385, 4.9681729 ],
[ 1.67006296, 3.63502087],
[ 1.55... 0.03564489],
[ 3.90688656, -2.11997105],
[-4.1205496 , 4.93055757],
[ 0.96344951, -3.00372179]])
bins = 32, range = None, axes_scale = 'linear', weights = None, color = '#02979d', hist_bin_factor = 1
smooth = 0.9, smooth1d = None, labels = array(['x', 'y'], dtype='<U4'), label_kwargs = {}
titles = array(['x', 'y'], dtype='<U4'), show_titles = True, title_fmt = '.2f', title_kwargs = {}
truths = None, truth_color = '#f5b754', scale_hist = False, quantiles = [0.16, 0.84]
title_quantiles = [0.16, 0.84], verbose = False, fig = None, max_n_ticks = 5, top_ticks = False
use_math_text = False, reverse = False, labelpad = 0.0, hist_kwargs = {'density': True}
hist2d_kwargs = {'fill_contours': True, 'levels': (0.3934693402873666, 0.8646647167633873, 0.9888910034617577), 'plot_datapoints': True, 'plot_density': True}
def corner_impl(
xs,
bins=20,
range=None,
axes_scale="linear",
weights=None,
color=None,
hist_bin_factor=1,
smooth=None,
smooth1d=None,
labels=None,
label_kwargs=None,
titles=None,
show_titles=False,
title_fmt=".2f",
title_kwargs=None,
truths=None,
truth_color="#4682b4",
scale_hist=False,
quantiles=None,
title_quantiles=None,
verbose=False,
fig=None,
max_n_ticks=5,
top_ticks=False,
use_math_text=False,
reverse=False,
labelpad=0.0,
hist_kwargs=None,
**hist2d_kwargs,
):
if quantiles is None:
quantiles = []
if title_kwargs is None:
title_kwargs = dict()
if label_kwargs is None:
label_kwargs = dict()
# If no separate titles are set, copy the axis labels
if titles is None:
titles = labels
# deal with title quantiles so they much quantiles unless desired otherwise
if title_quantiles is None:
if len(quantiles) > 0:
title_quantiles = quantiles
else:
# a default for when quantiles not supplied.
title_quantiles = [0.16, 0.5, 0.84]
if show_titles and len(title_quantiles) != 3:
> raise ValueError(
"'title_quantiles' must contain exactly three values; "
"pass a length-3 list or array using the 'title_quantiles' argument"
)
E ValueError: 'title_quantiles' must contain exactly three values; pass a length-3 list or array using the 'title_quantiles' argument
../../opt/mambaforge/envs/nessai/lib/python3.11/site-packages/corner/core.py:83: ValueError