Skip to content

Fix test warnings: suppress expected GPU/NaN warnings, fix real code issues#887

Merged
brendancol merged 1 commit intomasterfrom
chore/fix-test-warnings
Feb 24, 2026
Merged

Fix test warnings: suppress expected GPU/NaN warnings, fix real code issues#887
brendancol merged 1 commit intomasterfrom
chore/fix-test-warnings

Conversation

@brendancol
Copy link
Contributor

Summary

  • Add [tool:pytest] filterwarnings in setup.cfg to silence NumbaPerformanceWarning (GPU under-utilization from small test arrays — 28 instances)
  • Suppress RuntimeWarning for all-NaN slices in classify.py:_run_equal_interval, which is a valid code path handled correctly downstream (2 instances)
  • Fix DeprecationWarning in curvature.py by extracting scalars explicitly via cupy.asnumpy().item() instead of float() on an ndarray (12 instances)
  • Fix host-to-device copy overhead in focal.py and convolution.py by converting kernel to cupy.asarray() before passing to CUDA kernels (10 instances)

Reduces test warnings from 55 to 0 under normal pytest runs.

Test plan

  • pytest --tb=short -q passes (843 passed, 12 skipped, 0 warnings)
  • pytest -W all confirms DeprecationWarning, "Host array", and "All-NaN slice" warnings are gone (only expected NumbaPerformanceWarning remains, which -W all forces visible)

…version and host-array copies

- Add [tool:pytest] filterwarnings to silence NumbaPerformanceWarning from
  small test arrays
- Suppress RuntimeWarning for all-NaN slices in _run_equal_interval (valid
  code path)
- Fix DeprecationWarning in curvature.py by extracting scalar explicitly
  via cupy.asnumpy().item()
- Convert kernel to device array in focal.py and convolution.py to avoid
  implicit host-to-device copies
@brendancol brendancol merged commit e94a9b2 into master Feb 24, 2026
9 checks passed
This was referenced Feb 24, 2026
@brendancol brendancol deleted the chore/fix-test-warnings branch February 25, 2026 06:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant