Skip to content

Scalar numpy types handled incorrectly in fill method #452

@HDembinski

Description

@HDembinski

The fill method does not broadcast correctly in all cases.

import boost_histogram as bh
import numpy as np

r = bh.axis.Regular(5, 0, 1)
h = bh.Histogram(r, r)
h.fill(1, [1, 2]) # ok
h.fill(np.float64(1), [1, 2]) # fails

It not only does not work, but the error message is also very confusing:
ValueError: spans must have compatible lengths

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions