Some docstring examples in xrspatial/classify.py print results that do not match what the functions return, and five public classifiers have no Examples section.
Wrong example output (printed array differs from the actual result for the given input)
reclassify: the numpy, dask, and cupy blocks all print
[[nan,1,1,1,1],[1,2,2,2,2],[2,2,2,2,2],[2,3,3,3,3]]
but running the example produces
[[nan,1,1,1,1],[1,1,1,1,1],[1,2,2,2,2],[2,3,3,3,nan]].
equal_interval: the block prints
[[nan,0,0,0,0],[0,0,0,0,1],[1,1,1,1,1],[1,2,2,2,2],[2,2,2,2,nan]]
but running it produces
[[nan,0,0,0,0],[0,1,1,1,1],[2,2,2,2,2],[3,3,3,3,4],[4,4,4,4,nan]].
binary: the printed array uses np.nan where numpy reprs plain nan.
The test_classify.py fixtures confirm the functions behave correctly, so the docstring outputs are stale, not the code.
Missing Examples section
std_mean, head_tail_breaks, percentiles, maximum_breaks, and box_plot have Parameters, Returns, and References but no Examples block.
Scope
Documentation only (docstrings). No behavior change. Found via the documentation sweep on the classify module.
Some docstring examples in
xrspatial/classify.pyprint results that do not match what the functions return, and five public classifiers have no Examples section.Wrong example output (printed array differs from the actual result for the given input)
reclassify: the numpy, dask, and cupy blocks all print[[nan,1,1,1,1],[1,2,2,2,2],[2,2,2,2,2],[2,3,3,3,3]]but running the example produces
[[nan,1,1,1,1],[1,1,1,1,1],[1,2,2,2,2],[2,3,3,3,nan]].equal_interval: the block prints[[nan,0,0,0,0],[0,0,0,0,1],[1,1,1,1,1],[1,2,2,2,2],[2,2,2,2,nan]]but running it produces
[[nan,0,0,0,0],[0,1,1,1,1],[2,2,2,2,2],[3,3,3,3,4],[4,4,4,4,nan]].binary: the printed array usesnp.nanwhere numpy reprs plainnan.The
test_classify.pyfixtures confirm the functions behave correctly, so the docstring outputs are stale, not the code.Missing Examples section
std_mean,head_tail_breaks,percentiles,maximum_breaks, andbox_plothave Parameters, Returns, and References but no Examples block.Scope
Documentation only (docstrings). No behavior change. Found via the documentation sweep on the
classifymodule.