Skip to content

Commit

Permalink
Add check for matching axes types
Browse files Browse the repository at this point in the history
  • Loading branch information
amangoel185 committed Jun 29, 2021
1 parent 054c1c6 commit da0366f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/hist/stacks.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,12 @@ def __init__(
if len(args) == 0:
raise ValueError("There should be histograms or axes in Stack")
ndim = args[0].ndim
axestypes = set(map(type, args[0].axes))
for a in args:
if a.ndim != ndim:
raise ValueError("Histograms' dimensions don't match")
if axestypes != set(map(type, a.axes)):
raise ValueError("Histograms' axes types don't match")
self._stack = [*args]
self._stack_len = len(args)

Expand Down

0 comments on commit da0366f

Please sign in to comment.