We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Describe the bug
hist doesn't process negative indexing on axes.
hist
Steps to reproduce
import hist import numpy as np h1 = hist.new.Reg(10, 0, 10).Weight().fill(np.random.normal(5, 2, int(1e6))) # Works fine h1[1:4] # Throws an error h1[1:-2]
Trace:
--------------------------------------------------------------------------- ValueError Traceback (most recent call last) Cell In[8], line 1 ----> 1 h1[1:-2] File ~/software/micromamba/envs/def/lib/python3.11/site-packages/hist/basehist.py:324, in BaseHist.__getitem__(self, index) 317 def __getitem__( # type: ignore[override] 318 self: T, index: IndexingExpr 319 ) -> T | float | bh.accumulators.Accumulator: 320 """ 321 Get histogram item. 322 """ --> 324 return super().__getitem__(self._index_transform(index)) File ~/software/micromamba/envs/def/lib/python3.11/site-packages/boost_histogram/_internal/hist.py:908, in Histogram.__getitem__(self, index) 906 assert isinstance(start, int) 907 assert isinstance(stop, int) --> 908 slices.append(_core.algorithm.slice_and_rebin(i, start, stop, merge)) 910 # Will be updated below 911 if slices or pick_set or pick_each or integrations: ValueError: begin < end required
The text was updated successfully, but these errors were encountered:
@henryiii is this an intentional design choice, or is this an edge case that hadn't gotten caught yet?
Sorry, something went wrong.
No branches or pull requests
Describe the bug
hist
doesn't process negative indexing on axes.Steps to reproduce
Trace:
The text was updated successfully, but these errors were encountered: