Skip to content

Proposal: Rename VirtualArray in _nplikes.virtual to avoid confusion with ak.Array #3604

@ianna

Description

@ianna

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 VirtualArray has 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.Array and VirtualArray.

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions