cuda_histogram.axis package¶
- class cuda_histogram.axis.Bin(n_or_arr, lo=None, hi=None, *, name='', label='')¶
Bases:
DenseAxisSuper class for dense axes.
A binned axis with name, label, and binning.
- Parameters:
n_or_arr (int or list or np.ndarray) – Integer number of bins, if uniform binning. Otherwise, a list or numpy 1D array of bin boundaries.
lo (float, optional) – lower boundary of bin range, if uniform binning
hi (float, optional) – upper boundary of bin range, if uniform binning
name (str) – is used as a keyword in histogram filling, immutable
label (str) – describes the meaning of the axis, can be changed
This axis will generate frequencies for n+3 bins, special bin indices:
0 = underflow, n+1 = overflow, n+2 = nanflowBin boundaries are [lo, hi)- property _intervals¶
- _ireduce(the_slice)¶
- identifiers(flow=False)¶
List of Interval identifiers
- index(identifier)¶
Index of a identifier or label
- Parameters:
identifier (float or Interval or np.ndarray) – The identifier(s) to lookup. Supports vectorized calls when a numpy 1D array of numbers is passed.
Returns an integer corresponding to the index in the axis where the histogram would be filled. The integer range includes flow bins:
0 = underflow, n+1 = overflow, n+2 = nanflow
- property size¶
Number of bins
- class cuda_histogram.axis.Interval(lo, hi, label=None)¶
Bases:
objectReal number interval
Totally ordered, assuming no overlap in intervals. A special nan interval can be constructed, which is defined as greater than
[*, inf)- property hi¶
Upper boundary of this bin, exclusive
- property label¶
Label of this bin, mutable
- property lo¶
Lower boundary of this bin, inclusive
- property mid¶
Midpoint of this bin
- nan()¶
- class cuda_histogram.axis.Regular(bins, start, stop, *, name='', label='')¶
Bases:
BinMake a regular axis with nice keyword arguments for underflow, overflow, and growth.
- Parameters:
- reduced(islice)¶
Return a new axis with reduced binning The new binning corresponds to the slice made on this axis. Overflow will be taken care of by
Hist.__getitem__- Parameters:
islice (slice) –
islice.startandislice.stopshould be None or within[1, ax.size() - 1]This slice is usually as returned fromBin._ireduce
- class cuda_histogram.axis.Variable(edges, *, name='', label='')¶
Bases:
BinMake an axis with irregularly spaced bins. Provide a list or array of bin edges, and len(edges)-1 bins will be made.
- Parameters:
- reduced(islice)¶
Return a new axis with reduced binning The new binning corresponds to the slice made on this axis. Overflow will be taken care of by
Hist.__getitem__.- Parameters:
islice (slice) –
islice.startandislice.stopshould be None or within[1, ax.size() - 1]This slice is usually as returned fromBin._ireduce