Repository navigation
Index integer_array_t in NumPy like in VUnit - #26
Merged
Merged
Conversation
This was referenced Oct 14, 2026
ru551n
force-pushed
the
integer-array-xyz
branch
2 times, most recently
from
October 14, 2026 09:13
5a7c627 to
d0e5274
Compare
get(a, x, y, z) is now a[x, y, z] in Python, with shape (width, height, depth), for arguments and returned arrays alike, instead of a[y, x, z]. Arguments are views of the transferred storage with the first two axes swapped, and returned arrays are swapped back to VUnit's storage order. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ru551n
force-pushed
the
integer-array-xyz
branch
from
October 14, 2026 09:21
d0e5274 to
0e9f349
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.
An
integer_array_tis now indexed in Python like in VUnit:get(a, x, y, z)isa[x, y, z], with shape(width, height, depth). Before, the indices of the first two axes were swapped,a[y, x, z]with shape(height, width, depth).This is a breaking change, with a release note entry.
get(a, i)a[i]a[i](unchanged)get(a, x, y)a[y, x], shape(height, width)a[x, y], shape(width, height)get(a, x, y, z)a[y, x, z]a[x, y, z], shape(width, height, depth)How
shape[0]andshape[1].Things users will notice
a.reshape(-1)of a 3×2 array gives0, 10, 1, 11, 2, 12rather than VUnit's storage order. The test of a returned array with a new shape checks this.numpy.loadtxtof a CSV file written by VUnit'ssave_csvindex rows first. Such an array needsa.swapaxes(0, 1)(ora.Tin 2D), which the user guide now says.Changes
runtime.py:make_arrayswaps the axes of the view, and_array_resultswaps them back.tests/tb_python_pkg_bridge.vhd: the 2D/3D argument and result tests are indexed like VUnit now, and the flatten test has the new order.examples/embedded_python: theimage_model.pixeldocs and code, and the comment intb_example.vhd.docs/types.rst: the indexing table, plus a paragraph on row-first image libraries.release_notes/unreleased.md: a breaking change entry.Tests
Locally:
embedded_pythonexample on NVC and GHDL: 18/18, with the CI filters.-W: builds cleanly.🤖 Generated with Claude Code