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

linestyle argument in overlpot_points #254

Open
twhentschel opened this issue Feb 9, 2024 · 0 comments
Open

linestyle argument in overlpot_points #254

twhentschel opened this issue Feb 9, 2024 · 0 comments

Comments

@twhentschel
Copy link

OS: Ubuntu
Python Version: 3.9
Corner Version: v2.2.2

I've found a tiny, probably inconsequential bug in overplot_points related to passing the argument ls to change the linestyle

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)

val = np.mean(samples, axis=0)
corner.overplot_points(figure, val[None], ls="--")

This gives the error: TypeError: Got both 'ls' and 'linestyle', which are aliases of one another

I expected that this wouldn't give an error, and should be the same as calling replacing ls with linestyle in the call to overplot_points (which doesn't seem to affect the plot anyways).

I think the solution is to remove the line kwargs["linestyle"] = kwargs.pop("linestyle", "none") in the definition of overplot_points in src/corner/core.py. With this line gone, I no longer get this error and all tests are passed when running nox.

This is a small fix but I'd be happy to open a PR for it.

@twhentschel twhentschel changed the title Small bug in overlpot_points linestyle argument in overlpot_points Feb 26, 2024
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