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
Request for support of writing hist-derived profiles #908
Comments
I've had this in my email inbox for a week in order to say something intelligent about it, but all I can say is, yes: that would be a very good feature to have. Hopefully, we'll be able to get more effort on Uproot because there are a few important requests like this one. I'll just note that this is a high-priority item. |
Thanks for your response! I know that I'm making a request for a new feature without offering to actually help on the implementation, so I have no expectations about the timeline. (From what I can tell, it needs some expertise on PlottableHistogram that I don't have, but if you think it's something that could be completed in a couple of hours for someone new to the uproot internals, I'm willing to give it a shot). As always, thanks for all of your efforts! |
PR #1000 ensures that TProfiles can be read from ROOT and written to ROOT with 100% fidelity. It doesn't show that they can be taken from or to hist/boost-histogram, but that's a separate issue. When this is closed by PR #1000 getting merged, you may still want to check that. The thing I'm uncertain about is whether hist/boost-histogram's |
Thanks for implementing this! I ran some tests as a brief follow up and writing For my overall goal of merging and saving profiles, I think something is still going wrong around the to/from hist conversion (as you suspected). eg. If I add two |
I'd like to request writing support for profile hists that are coming from hist/boost-histogram. The use case I ran into was merging some root files containing a variety of histograms. My procedure was roughly:
__add__
functionality already implementedThe issue is in step 4. This works fine for standard histograms, and from the docs I understand that it should work for TProfile objects that aren't converted to hist (eg. just read by uproot, and still contained in a Model), but it doesn't work after I've done the conversion. Looking into the exception that's raised
https://github.com/scikit-hep/uproot5/blame/a9f4374607b7434ef89ebec82c784d34bfc31413/src/uproot/writing/identify.py#L248-L255
the
NotImplementedError
obviously suggests that profiles intentionally aren't supported at the moment, but theValueError
suggests that perhaps they were intended to be? In any case, adding support for writing profiles would be much appreciated, and would make merging hists a bit easier (this would be helpful becausehadd
isn't always available). Thanks!The text was updated successfully, but these errors were encountered: