Skip to content

Commit

Permalink
Better error when forgetting mosaic custom nodata (#144)
Browse files Browse the repository at this point in the history
  • Loading branch information
gjoseph92 authored Apr 7, 2022
1 parent a1816bc commit 100d682
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion stackstac/ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,9 @@ def mosaic(
if np.isnan(nodata) and arr.dtype.kind in "biu":
# Try to catch usage errors forgetting to set `nodata=`
raise ValueError(
f"Cannot use {nodata=} when mosaicing a {arr.dtype} array, since {nodata} cannot exist in the array."
"You've probably forgotten to pass a custom `nodata=` argument. "
f"Cannot use {nodata=} (the default) when mosaicing a {arr.dtype} array, "
f"since {nodata} cannot exist in that dtype. "
)

func = (
Expand Down

0 comments on commit 100d682

Please sign in to comment.