test(classify): cover all-NaN degenerate input across classifiers#3515
Conversation
Adds all-NaN regression tests for the classifiers that lacked them. std_mean and maximum_breaks already return an all-NaN result and get plain passing tests. head_tail_breaks, percentiles, and box_plot crash on all-NaN input (issue xarray-contrib#3510); their tests are xfail (non-strict) until that is fixed. Test-only change, no source modified.
Addresses review on PR xarray-contrib#3515. The all-NaN degenerate path diverges by backend, so the numpy-only tests missed cases: - std_mean, maximum_breaks: all-NaN on numpy and dask -> passing dask tests - head_tail_breaks: crashes eager but the dask path has a total_count == 0 guard and returns all-NaN -> plain passing dask test (documents xarray-contrib#3510 is eager-only) - percentiles, box_plot: crash on dask too -> xfail(xarray-contrib#3510) dask tests Also wraps the std_mean all-NaN tests in warnings.catch_warnings() to drop the empty-slice RuntimeWarnings. Test-only, no source modified.
Review: degenerate-input regression tests for classifyBlockers: none. Suggestion (addressed in a8cbf28): the all-NaN tests ran on numpy only, but the degenerate path diverges by backend. Running all five on dask:
Added five Note for #3510: the What looks good: |
Adds all-NaN regression tests for the classifiers that lacked them.
std_meanandmaximum_breaksalready return an all-NaN result onall-NaN input, so they get plain passing tests.
head_tail_breaks,percentiles, andbox_plotcurrently crash on all-NaN input, so theirtests are xfail (non-strict) and reference the source bug in #3510. Flip
them to plain assertions once #3510 is fixed.
equal_intervalandnatural_breaksalready had all-NaN coverage.Test-only change, no source modified. Ran locally on a CUDA host:
4 passed, 3 xfailed.
Found by the test-coverage sweep. Fixes the coverage half of #3510.