hist icon indicating copy to clipboard operation
hist copied to clipboard

[BUG] `Hist(bh.Histogram(...), name="something").name` errors out

Open Saransh-cpp opened this issue 6 months ago • 0 comments

Describe the bug

Passing a bh.Histogram object into hist.Hist with the name keyword argument does not work for name.

Steps to reproduce

In [1]: import hist; import boost_histogram as bh

In [2]: a = hist.axis.Regular(10, 0, 10, name="r")

In [3]: h = bh.Histogram(a)

In [4]: hist.Hist(a, name="hello")
Out[4]: Hist(Regular(10, 0, 10, name='r'), storage=Double())

In [5]: hist.Hist(h, name="hello").name
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
Cell In[5], line 1
----> 1 hist.Hist(h, name="hello").name

AttributeError: 'Hist' object has no attribute 'name'

In [6]: hist.Hist(a, name="hello").name
Out[6]: 'hello'

Saransh-cpp avatar Aug 15 '24 23:08 Saransh-cpp