soft-matter / trackpy

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

Added ability to use custom DistanceMetric #692

Closed freemansw1 closed 2 years ago

freemansw1 commented 2 years ago

Per #691, I added the ability to use a custom scikit-learn DistanceMetric function as a dist_func parameter in trackpy.link. I also added a new test for this method. I think that this would allow users to extend the DistanceMetric class, too, with compiled distance functions (and therefore faster than passing in a python function).

freemansw1 commented 2 years ago

It seems like I have increased my percentage of CI tests passed, but am still failing a few. It seems like the CI is failing on some code I didn't touch, but perhaps I caused it to fail from my edits. I'm happy to keep revising my PR as needed, but I would appreciate any insights on why the CI is failing. Thanks for your help on this!

nkeim commented 2 years ago

Those are (almost) certainly errors due to a new Pandas or matplotlib release, not in your code. To be safe, let's plan to merge once that's resolved.

Here's an instructive failed test that leads me to believe that: https://github.com/soft-matter/trackpy/runs/5276655344?check_suite_focus=true#step:5:41

freemansw1 commented 2 years ago

Thanks much for the insight and for your help with this PR!

nkeim commented 2 years ago

@freemansw1 the CI and compatibility problems that were holding this PR back have (hopefully) been fixed in the main branch. Please rebase when you get a chance. Thanks!

freemansw1 commented 2 years ago

I'm happy to rebase, but I don't see any changes to the main branch (actually I don't see main at all, just master).

freemansw1 commented 2 years ago

Sorry, I just want to check that you aren't waiting for me on anything @nkeim

nkeim commented 2 years ago

Looks like whatever dependency (or GHA) issues were at play in February are now gone; all checks pass. Thanks for your contribution @freemansw1 and for your patience!