Numba binning not producing the same result when providing bin edges as list
Created by: rettigl
Describe the bug When the new binning function get the bin edges as a list, it does not produce the same result as if it gets the bins as number of bins and bin ranges. The version with bin edges as list seems to ignore the last edge (?).
To Reproduce The following code executed in in the example data notebook reproduces the problem:
binAxes = ["t"]
nBins = [300]
binRanges = [(65000, 67000)]
res1 = bin_dataframe(
df=ddf,
axes=binAxes,
bins=nBins,
ranges=binRanges,
histMode="numba",
nCores=20,
)
binAxes = ["t"]
res2 = bin_dataframe(
df=ddf,
axes=binAxes,
bins=[(65000, 67000,300)],
histMode="numba",
nCores=20,
)
binAxes = ["t"]
nBins = np.linspace(65000, 67000, 300, endpoint=True)
res3 = bin_dataframe(
df=ddf,
axes=binAxes,
bins=nBins,
histMode="numba",
nCores=20,
)
res1.plot()
res2.plot()
res3.plot()
print((res1.t==res2.t).all())
print((res1==res2).all())
print((res1.t==res2.t).all())
print((res1==res3).all())
Output:
<xarray.DataArray 't' ()>
array(True)
<xarray.DataArray ()>
array(True)
<xarray.DataArray 't' ()>
array(True)
<xarray.DataArray ()>
array(False)
Expected behavior The results should be identical, as the t-axes are identical