Closed 0ctagon closed 2 weeks ago
Thanks @0ctagon! We previously wanted disallow passing bins
as an arg, when passing hist object to avoid conflicting information.
The refactor makes sense to me and separates the custom plottable
making logic outside of the histplot
function which is good.
We'll see if this causes any issues down the road, but if the tests pass I think we're good.
Idea is to have a
get_plottables()
to use internally in the future plothist function. Most of the things that created thePlottables
inhistplot
have been moved inget_plottables()
or to their own little function thatget_plottables()
is calling. Then, we can create and managePlottable
objects, so we can easily removeboost-histogram
dependency. The returnedPlottable
objects have a new argument_has_variances
to store the info if they had variances before the error is automatically calculated when creating thePlottable
object (before it was only calculated using.to_errorbar
just before plotting).This line:
self.variances = self.values if not self._has_variances else self.variances
inPlottable.errors()
is necessary as we query the variances a lot in plothist to compute uncertainties. I have concerns that this line might create problems (e.g. re-weighted histograms) but all the tests are passing for now. We might see differences when using it with plothist examples? maybeself.variances = self.values if not self.variances else self.variances
is safer?I'm also not sure about this change in
hist_object_handler()
:I didn't see a reason for this error.
@andrzejnovak @jonas-eschle @cyrraz