Skip to content

Use numpy.testing.assert_allclose and read arrays in 32 bit - #16

Merged
timor-amd merged 1 commit into
mainfrom
bugfix/full-sim-tests
Aug 29, 2026
Merged

Use numpy.testing.assert_allclose and read arrays in 32 bit#16
timor-amd merged 1 commit into
mainfrom
bugfix/full-sim-tests

Conversation

@timor-amd

Copy link
Copy Markdown
Collaborator

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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(...) with np.testing.assert_allclose(...) in Python tests.
  • Update AXI video testbench buffers to use np.uint32 instead of np.uint16 for packed input and captured output.
  • Rename the linebuffer sim test function to test_linebuffer_basic to 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.

Comment thread python/tb/test_demosaic.py Outdated
Comment thread python/tb/test_colorgain.py
Comment thread python/tb/test_blc.py
@timor-amd
timor-amd force-pushed the bugfix/full-sim-tests branch from c28909c to 43e6bd0 Compare August 29, 2026 20:53
@timor-amd
timor-amd merged commit 67e752d into main Aug 29, 2026
5 checks passed
@timor-amd
timor-amd deleted the bugfix/full-sim-tests branch August 29, 2026 21:42
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.

2 participants