refactor: factor get_plottables logic out of histplot #534
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 manage
Plottable
objects, so we can easily removeboost-histogram
dependency.The returned
Plottable
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
in
Plottable.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