soft-matter / trackpy

Python particle tracking toolkit
http://soft-matter.github.io/trackpy
Other
437 stars 131 forks source link

MNT: scipy, Pandas, sklearn compatibility #743

Closed nkeim closed 7 months ago

nkeim commented 7 months ago

Fixes failing tests for latest pandas and scipy.

nkeim commented 7 months ago

This is failing in a very special way on Windows. On that platform, somehow, compute_drift() returns a DataFrame with an int32 index. Obviously this is completely inconsequential and the tests could ignore it… but why is it happening at all?!?

    def test_no_drift(self):
        N = 10
        expected = DataFrame({'x': np.zeros(N), 'y': np.zeros(N)}).iloc[1:]
        expected = expected.astype('float')
        expected.index.name = 'frame'
        expected.columns = ['x', 'y']
        # ^ no drift measured for Frame 0

        actual = tp.compute_drift(self.dead_still)
>       assert_frame_equal(actual, expected[['y', 'x']])
nkeim commented 7 months ago

I still plan to merge and create a separate issue for the Windows test failures. Almost no actual users on Windows should be affected by this issue.