Use numpy.testing.assert_allclose and read arrays in 32 bit - #16
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Updates Python unit tests and cocotb testbenches to use NumPy’s np.testing.assert_allclose (for clearer failure output) and to pack/unpack pixel data using 32-bit arrays where appropriate, aligning test data types with wider datapaths and avoiding 16-bit truncation in simulations.
Changes:
- Replace
assert np.allclose(...)withnp.testing.assert_allclose(...)in Python tests. - Update AXI video testbench buffers to use
np.uint32instead ofnp.uint16for packed input and captured output. - Rename the linebuffer sim test function to
test_linebuffer_basicto match its module intent.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| python/test/test_utils.py | Switch bitsqrt test to np.testing.assert_allclose and remove unused commented variants. |
| python/test/test_gamma.py | Use np.testing.assert_allclose for gamma PWL comparison. |
| python/tb/test_minmaxmean.py | Pack input lines as np.uint32 when sending frames. |
| python/tb/test_linebuffer.py | Rename sim test to linebuffer and use np.uint32 for pack/unpack buffers. |
| python/tb/test_demosaic.py | Store unpacked result as np.uint32 and use np.testing.assert_allclose for comparison. |
| python/tb/test_colorgain.py | Use np.testing.assert_allclose for result/reference comparison. |
| python/tb/test_blc.py | Use np.testing.assert_allclose for result/reference comparison. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
timor-amd
force-pushed
the
bugfix/full-sim-tests
branch
from
August 29, 2026 20:53
c28909c to
43e6bd0
Compare
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.
No description provided.