novaphy.DeviceArray concrete classes¶
Concrete DeviceArray<T> wrappers exposed by Model, SimState, Control,
and Contacts. They provide device-aware storage. Buffered numeric, enum, and
fixed-width vector specializations expose .numpy(), which allocates and
returns a host snapshot; it is never a writable view into the underlying
buffer. Object specializations such as DeviceArrayTransform,
DeviceArrayRigidBody, and DeviceArrayCollisionFilterPair do not expose
.numpy() or the Python buffer protocol.
Public Top-Level Classes¶
| Class | Typical use |
|---|---|
DeviceArrayFloat, DeviceArrayFloat6, DeviceArrayFloat7 |
Scalar and fixed-width float buffers. |
DeviceArrayInt, DeviceArrayInt64, DeviceArrayUInt8, DeviceArrayUInt32, DeviceArrayUIntPtr |
Integer and pointer-sized buffers. |
DeviceArrayVec3f, DeviceArrayVec3i |
Vector buffers exposed as two-dimensional NumPy views. |
DeviceArrayJointType, DeviceArrayJointTargetMode, DeviceArrayShapeType |
Enum-backed flat buffers. |
DeviceArrayTransform, DeviceArrayRigidBody, DeviceArrayCollisionFilterPair |
Object buffers used for topology and metadata. |
Notes¶
- Python properties on
Model,SimState,Control, andContactsreturn these concrete classes when the underlying storage is device-backed. - For buffered element types on CPU,
np.asarray(device_array)uses the Python buffer protocol and can provide a zero-copy view. The buffer protocol is unavailable for CUDA arrays;.numpy()performs the required host readback and still returns a copy. - Mutating an array returned by
.numpy()or the Pythonhost_view()does not write back. Useassign(),assign_device(),fill(),fill_zero(), indexed assignment, or an owning object's documented setter. - Use the owning runtime object's helper methods when available. For example,
mutate velocities through
SimStatesetters when synchronization between component arrays and flat buffers matters. - Access object specializations through indexing/iteration or the owning object's typed helpers.
- Some concrete
_corespecializations exist for internal storage but are not exported through top-levelnovaphy.__all__.