scikit-hep / hist

Histogramming for analysis powered by boost-histogram
https://hist.readthedocs.io
BSD 3-Clause "New" or "Revised" License
127 stars 26 forks source link

[BUG] Axis label propagation when wrapping histogram by `hist.Hist` #549

Open alexander-held opened 10 months ago

alexander-held commented 10 months ago

Describe the bug

When wrapping an existing histogram object by hist.Hist(), I expected that I can set metadata (such as axis labels) in the hist.Hist() call. This currently does not work, see reproducer below.

Am I using the interface in the wrong way here?

Steps to reproduce

import boost_histogram as bh
import hist

boost_h = bh.Histogram(bh.axis.Regular(2, 0, 1))
print(hist.Hist(boost_h, label="abc").axes[0].label)

-> prints Axis 0

relevant versions:

boost-histogram               1.3.2
hist                          2.7.2