Open peterstangl opened 3 years ago
I suggest not using something other than a list/array for levels
because it's the same name as the argument of matplotlib
's contour
, which just takes an int
or list/array.
I also suggest not using dictionaries as function arguments, because that's very hard to document and use properly (Jupyter tab signature hints; type hints; ...). If you want to go down this road, I suggest to add all of them as keyword arguments.
fpl.contour(
x,
y,
z,
*,
levels: Optional[Sequence[int]] = None,
n_sigma: Optional[Sequence[int]] = None,
dof: int = 2,
type: str = "chi2",
)
As mentioned in issue #143,
I actually think that it might be better if
likelihood_contour_data
would not return thelevels
at all. In principle, the levels can always be changed without recomputing the contour data and this is not very clear at the moment. In addition to changing the DOF, one might also want to changen_sigma
after one has computed the plot data. The fact thatlikelihood_contour_data
has then_sigma
argument suggests that one has to recompute all the data in this case. But this is actually not necessary.One idea for
contours
would be to use thelevels
argument in two different ways:type
andn_sigma
are mandatory and the keydof
is optional. The value oftype
could then be e.g.likelihood
,chi2
,log-likelihood
.By this, we could avoid additional functions or the need to use
levels=[delta_chi2(n, dof) for n in n_sigma]
. Calling contours would just look like e.g.or
It is a bit confusing that
likelihood_contour_data
actually returns neither likelihood nor log-likelihood but chi2 values.