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

[MRG] Only Minkowski metrics can be used for emd_1d #670

Merged
merged 5 commits into from
Aug 21, 2024

Conversation

rtavenar
Copy link
Contributor

@rtavenar rtavenar commented Aug 20, 2024

Types of changes

The point here is to prevent anyone from using the emd_1d and emd2_1d functions with metrics that are not Minkowski ones, since this implementation is valid only in this case.

As such, I have left the opportunity to use 'sqeuclidean', 'minkowski', 'cityblock', or 'euclidean' as metrics. Another option would be to remove the metrics keyword and only specify p, but that would break backward compatibility, so I assumed this change was better for maintenance purposes. Let me know if this should be changed.

Motivation and context / Related issue

This PR aims at solving issue #669.

How has this been tested (if it applies)

Not tested yet.

PR checklist

  • I have read the CONTRIBUTING document.
  • The documentation is up-to-date with the changes I made (check build artifacts).
  • All tests passed, and additional code has been covered with new tests.
  • I have added the PR and Issue fix to the RELEASES.md file.

Copy link

codecov bot commented Aug 20, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.78%. Comparing base (36c9252) to head (4a7d119).
Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #670   +/-   ##
=======================================
  Coverage   96.78%   96.78%           
=======================================
  Files          88       88           
  Lines       17502    17506    +4     
=======================================
+ Hits        16940    16944    +4     
  Misses        562      562           

@rflamary rflamary changed the title [WIP] Only Minkowski metrics can be used for emd_1d [MRG] Only Minkowski metrics can be used for emd_1d Aug 21, 2024
@rflamary rflamary merged commit 0b59002 into PythonOT:master Aug 21, 2024
17 checks passed
@rtavenar rtavenar deleted the emd_1d_dist branch August 21, 2024 07:18
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.

2 participants