-
Notifications
You must be signed in to change notification settings - Fork 21
Closed
Labels
Description
When binning is attempted on an empty data, it's throwing BinEdgeError with the error message Bin edges in dim {coord-name} must be sorted..
Maybe it should catch the error earlier and throw a more specific error.
Code snippet to reproduce this error is below the image.
Code snippet to reproduce the issue
import scipp as sc
import numpy as np
rng = np.random.default_rng(123)
da = sc.DataArray(data=sc.ones(sizes={"row": 1000}, unit="counts"),
coords={'longi': sc.array(dims=['row'], values=rng.random(1000)),
'lati': sc.array(dims=['row'], values=rng.random(1000)),
'time': sc.array(dims=['row'], values=rng.random(1000))})
empty_b = da.bin(lati=sc.array(dims=['lati'], values=[0.0, 1.2, 2.0]))['lati', 1]
empty_b.bin(longi=10)
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Done
