Closed kevin-duclos closed 9 months ago
Thanks @kevin-duclos . The error in #734 makes sense, except it should occur any time that there are many particles, including in the trackpy tests. So I'm confused.
I made changes to subtract_drift()
and its docstring that I think address @caspervdw 's concern. However, at least temporarily, I added some lines to the tests that are supposed to trigger this error. We'll see if any of the CI environments catch it.
OK, I think this is ready to merge. In addition to the fix by @kevin-duclos , we now include two tests with no particle
column:
subtract_drift()
with feature data prior to tracking. Note that compute_drift()
requires a particle
column, so the user would need to compute the drift some other way. I still don't know why this doesn't cause an error, but since it's a reasonable use case, we might as well test it.I think this is ready to merge. @caspervdw does this address your question? @kevin-duclos do you think this still fixes the bug?
Just bumping this issue, especially for @kevin-duclos : Is this OK to merge?
All good with me, @nkeim. Thanks!
After the 0.6.2 update, the dataframe processed by subtract_drift() poses an issue for imsd() due to the presence of "particle" in both row and column indices. To address this, it needs to use dataframe.reset_index(drop=True) before running the function to ensure proper execution.
Change traj.set_index call to avoid Pandas error: 'ValueError: cannot reindex on an axis with duplicate labels'.