opensim-org / opensim-core

SimTK OpenSim C++ libraries and command-line applications, and Java/Python wrapping.
https://opensim.stanford.edu
Apache License 2.0
783 stars 316 forks source link

Convert `RowVectorView` to `RowVector` in Python bindings `to_numpy()` extension #3613

Closed nickbianco closed 10 months ago

nickbianco commented 10 months ago

Fixes issue #3439

Brief summary of changes

This PR modifies the Python interface extension to_numpy for RowVectorBase. This change is needed since RowVectorView does not have contiguous data, yet we use getContiguousScalarData() to copy the row vector contents into the target Python array.

Testing I've completed

Updated test_simbody.py. The modified test failed before the fix, and passed after the fix.

Looking for feedback on...

CHANGELOG.md (choose one)


This change is Reviewable