scikit-hep / hist

Histogramming for analysis powered by boost-histogram

Home Page:https://hist.readthedocs.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[BUG] division on Int64 storage kills kernel

andrzejnovak opened this issue · comments

Example below:

import hist, numpy as np

hmap1 = (hist.new
            .Reg(10, 0, 10, name='x', flow=False)
            .Reg(10, 0, 10, name='y', flow=False)
            .Int64()
       ).fill(np.random.normal(5, 3, 1000), np.random.normal(5, 3, 1000))

hmap2 = (hist.new
            .Reg(10, 0, 10, name='x', flow=False)
            .Reg(10, 0, 10, name='y', flow=False)
            .Int64()
       ).fill(np.random.normal(3, 3, 1000), np.random.normal(3, 3, 1000))


hmap1/hmap2

Possibly should be a separate issue, but while the above works with Double() storage, division on it breaks the repr.

image
image

The repr is normalized, so it's leaking NaN's in, which breaks it - we should filter/mask those. Will have to investigate the integer division one!

Thanks!