Skip to content

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

@Saransh-cpp

Description

@Saransh-cpp

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'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions