Add regression tests for goldstein edge handling#730
Open
scottstanie wants to merge 1 commit into
Open
Conversation
Cover the edge cases the reflect-pad + weight-normalization goldstein implementation is meant to handle, none of which were previously tested: - non-multiple-of-psize array dimensions (full edge coverage) - edge weight normalization (no darkening at borders) - valid phase == 0 preserved (not treated as empty) - arrays smaller than the window Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds regression tests for the Goldstein filter's edge handling. The current
goldstein.pyimplementation (reflect-padding + weight normalization + treating only zero-magnitude complex values as empty) is not currently covered by tests.Tests added (
tests/test_filtering.py::TestGoldstein)test_goldstein_non_multiple_dimensions- arrays whose dimensions are not a multiple of the patch size are fully covered to the edges (no empty bottom/right)test_goldstein_edge_normalization- border pixels are weight-normalized (no darkening where fewer windows overlap)test_goldstein_preserves_zero_phase- valid pixels with phase == 0 are not treated as emptytest_goldstein_small_array- arrays smaller than the window are handledNo source changes - tests only.
🤖 Generated with Claude Code