opensim-core icon indicating copy to clipboard operation
opensim-core copied to clipboard

Add setters to `DataTable.h` to make setting columns scripting-friendly

Open nickbianco opened this issue 2 years ago • 2 comments

Brief summary of changes

This PR introduces the methods setDependentColumnAtIndex and setDependentColumn (two signatures each) for setting dependent columns in DataTables. These are more scripting-friendly, whereas the upd-based methods fail.

Testing I've completed

Added tests to testDataTable.cpp.

Looking for feedback on...

These methods are needed because interacting with the VectorView object doesn't work in scripting. I could see the argument for fixing this issue directly, but this update is probably more straight-forward and these methods generally useful.

CHANGELOG.md (choose one)

  • updated.

This change is Reviewable

nickbianco avatar Jul 25 '22 22:07 nickbianco

@nickbianco Can we include a call to this method in a python and/or java testcase since this is intended to help scripting? Also to see if a more general solution could be worked out. Thank you

aymanhab avatar Jul 25 '22 22:07 aymanhab

@aymanhab I'll update the testing soon to include a scripting test case.

nickbianco avatar Jul 25 '22 22:07 nickbianco

After some quick testing, I've realized that the upd-based methods do work as intended in Python. Will check to confirm the same behavior in Matlab, and if so, will close the PR.

nickbianco avatar Aug 24 '22 21:08 nickbianco

upd methods work in Matlab as well. Closing this PR.

nickbianco avatar Aug 25 '22 16:08 nickbianco