test: 20 tests for naive_median, geometric_median, convert_image_to_ascii#28
Open
hai-pilgrim wants to merge 2 commits intomarksverdhei:mainfrom
Open
test: 20 tests for naive_median, geometric_median, convert_image_to_ascii#28hai-pilgrim wants to merge 2 commits intomarksverdhei:mainfrom
hai-pilgrim wants to merge 2 commits intomarksverdhei:mainfrom
Conversation
Adds a --compare CLI flag that outputs a side-by-side comparison image instead of just the processed result. The after image is upscaled to the original's dimensions using NEAREST resampling (preserving pixel edges), then placed alongside the original with "Before" / "After" labels. spritegrid input.png --compare -o comparison.png Comparison is suppressed in debug mode (--debug) and when the image is already clean pixel art (1:1 detection). Includes 9 unit tests. Closes marksverdhei#16 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…scii Covers naive_median (1D/2D, odd/even count, single point, symmetric), geometric_median (single point, symmetric 1D, identical points, returns numpy array, collinear convergence, close to naive for symmetric data), and convert_image_to_ascii (string return, fully transparent → spaces, ANSI escape codes, ascii_space_width multiplier, newline per row, AssertionError on invalid width). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 task
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
spritegrid/utils.pyfunctions that were previously uncoverednaive_median: 1D/2D inputs, odd/even count, single point, symmetric distributiongeometric_median: single point, symmetric 1D (returns center), identical points, numpy array return type, collinear convergence bounds, close to naive median on symmetric dataconvert_image_to_ascii: string return type, fully transparent image → spaces only, ANSI escape codes present for opaque pixels,ascii_space_widthmultiplier, newlines per row,AssertionErroron zero and None widthTest plan
uv run pytest tests/test_utils.py -q🤖 Generated with Claude Code