Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when specifying truths for 1-D data #285

Open
mj-will opened this issue Dec 2, 2024 · 0 comments
Open

Error when specifying truths for 1-D data #285

mj-will opened this issue Dec 2, 2024 · 0 comments

Comments

@mj-will
Copy link

mj-will commented Dec 2, 2024

Calling corner.corner with 1-dimensional data and truths leads to a TypeError, see the traceback and example below.

As far as I can tell, this is new to v2.2.3 and works in previous versions.

Traceback

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/mjwill/.conda/envs/nessai/lib/python3.10/site-packages/corner/corner.py", line 280, in corner
    return arviz_corner(
  File "/home/mjwill/.conda/envs/nessai/lib/python3.10/site-packages/corner/arviz_corner.py", line 136, in arviz_corner
    fig = corner_impl(
  File "/home/mjwill/.conda/envs/nessai/lib/python3.10/site-packages/corner/core.py", line 457, in corner_impl
    overplot_lines(fig, truths, reverse=reverse, color=truth_color)
  File "/home/mjwill/.conda/envs/nessai/lib/python3.10/site-packages/corner/core.py", line 847, in overplot_lines
    axes[k1, k1].axvline(xs[k1], **kwargs)
TypeError: 'AxesSubplot' object is not subscriptable

Minimum example

import corner
import numpy as np
rng = np.random.default_rng()
data = rng.standard_normal(size=(1000, 1))
corner.corner(data, truths=[0])
mj-will added a commit to mj-will/nessai that referenced this issue Dec 12, 2024
Temporarily mark this test as `xfail` due to dfm/corner.py#285
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant