Having title_quantiles=None when quantiles is passed without having exactly 3 elements raises a ValueError
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 48/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Stale
- Tech stack
- numpy, python
- Domain
- data-visualization
Research direction
Start at the corner.corner entry point and reproduce the issue with the modified Getting started example using quantiles=[0.16, 0.84], show_titles=True, and title_quantiles=None. Trace how these arguments are validated and confirm that the compatibility case completes without the reported ValueError.
Written by the indexing model from the issue text.
Description
Hi,
The behaviour of the title_quantiles argument that was introduced in v2.2.2 is responsible for a crash when using the following set of arguments:
show_titles=True, title_quantiles=None
and a list for quantiles that has a number of elements other than 3. In this case, according to what is written in the documentation, the value for title_quantiles is set as what is passed for quantiles, and a ValueError is raised.
In particular, this is an issue for compatibility with codes that were running with corner versions older than v2.2.2.
The error can be reproduced by slightly modifying the code from the Getting started tutorial (https://corner.readthedocs.io/en/latest/pages/quickstart/):
import corner
import numpy as np
ndim, nsamples = 2, 10000
np.random.seed(42)
samples = np.random.randn(ndim * nsamples).reshape([nsamples, ndim])
figure = corner.corner(samples, quantiles=[0.16, 0.84],
show_titles=True, title_quantiles=None)
Running this code, the following error is raised:
ValueError: 'title_quantiles' must contain exactly three values; pass a length-3 list or array using the 'title_quantiles' argument
- Dominant language
- Python
- Stars
- 576
- Forks
- 234
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from dfm/corner.py
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 3/5 1-2 days Newbie friendliness 64/100
-
Double corner plots Open
Difficulty 3/5 1-2 days Newbie friendliness 48/100
-
Difficulty 3/5 1-2 days Newbie friendliness 30/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 50/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100