Skip to content

Commit

Permalink
add simple test
Browse files Browse the repository at this point in the history
  • Loading branch information
cyrraz committed Jan 25, 2024
1 parent 3c7c8af commit 3511c5e
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/test_histogramming.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
from plothist import make_hist
import boost_histogram as bh


def test_make_hist():
"""
Test make_hist() function.
"""
h = make_hist(data=[0, 1, 2, 3, 4], bins=5, range=(0, 5))
assert isinstance(h, bh.Histogram)
assert isinstance(h.axes[0], bh.axis.Regular)
assert h.sum().value == 5
assert h.sum().variance == 5
assert h[0].value == 1
assert h[-1].value == 1

0 comments on commit 3511c5e

Please sign in to comment.