Describe the bug
The five public functions in xrspatial/edge_detection.py (sobel_x, sobel_y, laplacian, prewitt_x, prewitt_y) skip the _validate_raster() check that sibling modules (aspect, slope, curvature, bilateral) run on agg at the top of each public function. Passing a bare np.ndarray raises AttributeError from agg.data instead of a clean TypeError, and a 1-D DataArray fails inside numba/cupy with a confusing message instead of a clean ValueError.
Cat 6 (input validation / dtype confusion) finding from the latest security sweep, severity MEDIUM. Numerical correctness is fine because convolve_2d._promote_float already casts integer dtypes to float32, so this is purely an error-message UX issue.
Expected behavior
Each function should call _validate_raster(agg, func_name='<name>', name='agg') at the top, matching the call style in aspect.py line 400. Non-DataArray input should raise TypeError, wrong-ndim input should raise ValueError.
Additional context
Tests parametrize over float64, so the default numeric=True is fine and does not need to be overridden.
Describe the bug
The five public functions in
xrspatial/edge_detection.py(sobel_x,sobel_y,laplacian,prewitt_x,prewitt_y) skip the_validate_raster()check that sibling modules (aspect, slope, curvature, bilateral) run onaggat the top of each public function. Passing a barenp.ndarrayraisesAttributeErrorfromagg.datainstead of a cleanTypeError, and a 1-D DataArray fails inside numba/cupy with a confusing message instead of a cleanValueError.Cat 6 (input validation / dtype confusion) finding from the latest security sweep, severity MEDIUM. Numerical correctness is fine because
convolve_2d._promote_floatalready casts integer dtypes to float32, so this is purely an error-message UX issue.Expected behavior
Each function should call
_validate_raster(agg, func_name='<name>', name='agg')at the top, matching the call style inaspect.pyline 400. Non-DataArray input should raiseTypeError, wrong-ndim input should raiseValueError.Additional context
Tests parametrize over float64, so the default
numeric=Trueis fine and does not need to be overridden.