fix: writing TProfiles from hist
This PR adds some flexibility to the hist profiles that can be written to file. The old code was assuming ROOT histograms that were converted to hist with to_hist, which adds some metadata, but if the metadata was not present it just didn't work. Someone should double-check that I'm inputting the right data into to_TProfile. Closes #1531.
@pfackeldey could you take a look at this since you're good with histograms?
thanks, it seems to work, even if I have to simplify my original code. For example with storage=hist.storage.WeightedMean() it doesn't work #1533 and ND profiles are not supported #1534.
By the way, I get a warning
FutureWarning: .metadata was not set, returning None instead of Attribute error, boost-histogram 1.7+ will error.
if obj.metadata is not None and "fSumw2" in obj.metadata.keys():
Thank you, @wiso! I fixed the warning and the WeightedMean storage. I'll follow up on the ND profiles on a separate PR.