Skip to content

test: cover normalize multichannel, NaN, and validation paths#194

Draft
wkentaro wants to merge 1 commit into
mainfrom
test/normalize-coverage
Draft

test: cover normalize multichannel, NaN, and validation paths#194
wkentaro wants to merge 1 commit into
mainfrom
test/normalize-coverage

Conversation

@wkentaro

Copy link
Copy Markdown
Owner

normalize only had happy-path coverage; its multichannel branch, NaN handling,
and four validation/warning guards were untested.

Summary

  • Cover per-channel normalization for a 3-D image (auto and explicit min/max).
  • Cover NaN propagation: a NaN stays NaN in 2-D, and a NaN in any channel
    poisons the whole pixel in a multichannel image.
  • Cover the ndim, min_value.shape, and max_value.shape ValueError guards.
  • Cover the inf UserWarning emitted when a min or max value is infinite.

Test plan

  • uv run pytest tests/unit/_normalize_test.py (11 passed)
  • full suite uv run --extra all pytest -n=auto tests (255 passed)
  • uv run ruff check, ruff format --check, ty check on the changed file

@wkentaro wkentaro self-assigned this Jun 10, 2026
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