Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Henry Schreiner
    @henryiii
    The point of hist.plot is to have a quick way to make a plot. If you want to import stuff, you can make figures/axes with plt, use mplhep.histplot, etc. Just like pandas, “.plot” is intended to be a shortcut for exploration, so mimicking the pandas API for quick-plotting isn’t unreasonable.
    But I don’t want this to balloon, either, and skills you learn for matplotlib are composable / work anywhere, including other matplotlib plots, such as from pandas
    Henry Schreiner
    @henryiii
    Supporing the pandas plot API might be something we could make a bit more formal. Will look into it.
    Matthew Feickert
    @matthewfeickert

    This isn't directly related, but this is reminding me of when I learned about how to use interactive vs. non-interactive matploltlib backends earlier this year and how that relates between using the matplotlib.pyplot.subplots vs. matplotlib.figure.Figure APIs

    https://gist.github.com/matthewfeickert/84245837f09673b2e7afea929c016904

    1 reply
    Henry Schreiner
    @henryiii
    Looks like plothist from mplhep already duplicates / provides a lot of this. I’d think keeping that simple and only having the shortcuts .plot would have been better.
    veprbl
    @veprbl:matrix.org
    [m]
    Hey! I have a question: Is there a file format that allows interop between C++ and python boost-histogram?
    Henry Schreiner
    @henryiii
    It’s planned. I think you can find a dissussion of it little while back in this(?) channel.
    veprbl
    @veprbl:matrix.org
    [m]
    I see. Thanks!
    Henry Schreiner
    @henryiii
    Shiny new versions of boost-histogram and hist are out, just in time for the talk at PyHEP. Watch the talk in 6.5 hours on Zoom or YouTube LiveStream (I think) to see what’s new!
    Angus Hollands
    @agoose77:matrix.org
    [m]
    I misread that as a 6.5 hour talk 😂 looking forward to it!
    Raghav Kansal
    @rkansal47
    Hi, i was wondering if there's a recommended way of keeping track of errors, e.g. when dividing two hists?
    Henry Schreiner
    @henryiii:matrix.org
    [m]
    I think views handle this correctly (and if not, it's likely a bug 😉) - h.view() / h2.view()
    Raghav Kansal
    @rkansal47
    oh sorry i meant errors as in confidence intervals but i think i found what i was looking for https://hist.readthedocs.io/en/latest/reference/hist.html#module-hist.intervals :)
    Henry Schreiner
    @henryiii
    Hist is now Python 3.7+ only following NEP 29 (3.6 users will still get Hist 2.4)
    Andrzej Novak
    @andrzejnovak
    yay
    Matthew Feickert
    @matthewfeickert
    @henryiii @LovelyBuggies If you have a hist.hist.Hist object that someone else made and serialized to give to you, and upon deserializing realize that the name and label field for the axes has information that should have been put in metadata placed in them (e.g., hist_1.axes[0].name gives wjets instead of something like pt) is there a way to update the name and label in a copy of the histogram? name and label are read only in boost-histogram, so is there any way to get around this other then manually making new histogram objects and filling them with the old histogram contents?
    Henry Schreiner
    @henryiii
    Well, label is easy, it's not read-only. Only name is, because we validate that it doesn't get duplicated inside a histogram. You can set it via a secret method (hist_1.axes[0]._ax.metadata, IIRC), but I've intended to allow it to be set in bulk, that is, hist.axes.name = ("name1", "name2"), as that we can validate. I'll open an issue for that.
    Ethan Simpson
    @ethansimpson285
    Hi there, thanks for the great work on PyHEP histogram infrastructure. Apologies in advance, I feel this is a common question concerning bin errors and ratio plots. My main question is if there is a boost-histogram method to access the bin error, something that does the computation np.sqrt(h.values()))automatically? For generating ratio plots I understand I can use the hist.intervalsmodule, is this the current "best practice"?
    Henry Schreiner
    @henryiii
    np.sqrt(h.variances()) is better (though you need to be a tiny bit careful if the variances is None, which can happen for non-weighted storages if you fill with a weight)
    Ethan Simpson
    @ethansimpson285
    np.sqrt(h.variances()) is None when considering a normalised histogram as computed via h/h.sum(), though the errors are then computable using hist.intervals. Not sure if there's any better way to derive such a normalised histogram...
    Nicholas Smith
    @nsmith-
    I would advocate that hist automatically converts any scalar storage to Weight storage upon scaling, to preserve the unweighted count
    Henry Schreiner
    @henryiii
    Please add that to scikit-hep/boost-histogram#601
    Henry Schreiner
    @henryiii
    Didn’t mean you had to recommend it for division, just that the two things are related, once we start changing storages on operations, that’s something it would open up.
    Nicholas Smith
    @nsmith-
    np just being clear
    Henry Schreiner
    @henryiii
    boost-histogram 1.2.0 is out, with Python 3.10 wheels, histogram subtraction, and several important performance improvements (up to 1000x for picking from huge histograms), and important bug fixes for user reported issues. A couple more known issues should be worked out in the near future, so expect a 1.2.1 eventually, but this is a clear imrovement all around over 1.1.0. :)
    Hist is locked against boost-histogram, so expect a hist release in the near future based on 1.2. :)
    Andrzej Novak
    @andrzejnovak
    Nice
    Henry Schreiner
    @henryiii
    Hist 2.5 is out, built on boost-histogram 1.2, and lots of Stacks improvements, bulk axes name setting, better QuickConstruct, and more.
    Matthew Feickert
    @matthewfeickert
    Woo! :)