-
Notifications
You must be signed in to change notification settings - Fork 120
Description
The class awkward._nplikes.virtual.VirtualArray has an interface that closely resembles np.ndarray — e.g. .T, .dtype, .shape, .copy(), .view(), etc.
However, its name — VirtualArray — can be misleading because:
-
It suggests similarity to the high-level
ak.Array, which has very different semantics and API. -
It lives in
_nplikes, and is clearly intended as a NumPy-like backend buffer — not part of the layout system or high-level user-facing types. -
It is used to represent deferred or lazy array data, not high-level structured content.
Why the current name is problematic
-
It causes confusion for new contributors trying to distinguish between layout classes, high-level types, and low-level buffers.
-
The name
VirtualArrayhas historically been used in Awkward layouts (v1), so this can create further ambiguity. -
It makes it harder to explain or reason about tests and code paths that involve both
ak.ArrayandVirtualArray.
Suggested rename
To reduce confusion and clarify intent, I propose renaming it to something more accurate and self-descriptive, such as:
VirtualNumpyArray
LazyNumpyLike
DeferredArrayLike
VirtualBufferLike
NumpyThunk
Benefits
-
Makes the role of the class clearer as a low-level, NumPy-like array object.
-
Prevents accidental assumptions that it's part of the layout or high-level API.
-
Aids onboarding, refactoring, and testing by making internal roles more self-evident.