Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: calculate_distance_matrix computes all pairs #594

Merged
merged 5 commits into from
Jan 7, 2024

Conversation

bifbof
Copy link
Collaborator

@bifbof bifbof commented Jan 4, 2024

fixes #592
One of the added tests has a very generous relative tolerance, this is due to #593.
I made this function probably quite a bit slower. I thought that correctness is more important and if nobody experienced this bug in 3 years maybe it isn't called that often either.
Tried to use pairwise distance for everything. That wasn't possible for the LineStrings as sklearn and scipy both enforce float as data type. Thus I copied the code out of sklearn and adapted it a bit.

Copy link

codecov bot commented Jan 4, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (e98354d) 93.15% compared to head (061299e) 93.30%.

❗ Current head 061299e differs from pull request most recent head c1b4182. Consider uploading reports for the commit c1b4182 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #594      +/-   ##
==========================================
+ Coverage   93.15%   93.30%   +0.14%     
==========================================
  Files          33       33              
  Lines        2104     2076      -28     
  Branches      374      368       -6     
==========================================
- Hits         1960     1937      -23     
+ Misses        130      127       -3     
+ Partials       14       12       -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@hongyeehh hongyeehh self-assigned this Jan 4, 2024
Copy link
Member

@hongyeehh hongyeehh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix! The current version is much cleaner and easier to maintain. I only have a minor comment relating to n_jobs docstring

trackintel/geogr/distances.py Outdated Show resolved Hide resolved
@bifbof bifbof merged commit 495443f into mie-lab:master Jan 7, 2024
6 checks passed
@bifbof bifbof deleted the dist branch January 7, 2024 13:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: calculate_distance_matrix does not compute all distance pairs.
2 participants