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] raise error if mass mismatch in emd2 #386

Merged
merged 11 commits into from
Jun 21, 2022

Conversation

clecoz
Copy link
Contributor

@clecoz clecoz commented Jun 20, 2022

Types of changes

  • Add a test on the masses of the distributions in emd2. If the histograms (a and b) do not have the same sum (up to a certain precision), an AssertionError is raised.
  • The sum of the target histogram (b) is adjusted to match the sum of the source histogram (a).

Motivation and context / Related issue

How has this been tested (if it applies)

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.

Camille Le Coz and others added 4 commits June 20, 2022 15:28
… have the same mass (same as it already was in the function emd).
The function test_emd_dimension_and_mass_mismatch (in test/test_ot.py) has been modified to check for mass mismatch with emd2.
@codecov
Copy link

codecov bot commented Jun 20, 2022

Codecov Report

Merging #386 (d81f0d3) into master (e547fe3) will decrease coverage by 0.03%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master     #386      +/-   ##
==========================================
- Coverage   93.79%   93.76%   -0.04%     
==========================================
  Files          23       23              
  Lines        5934     5936       +2     
==========================================
  Hits         5566     5566              
- Misses        368      370       +2     

@clecoz clecoz marked this pull request as draft June 21, 2022 07:45
@clecoz clecoz marked this pull request as ready for review June 21, 2022 13:48
@rflamary rflamary changed the title [WIP] raise error if mass mismatch in emd2 [MRG] raise error if mass mismatch in emd2 Jun 21, 2022
@rflamary rflamary merged commit 7c2a952 into PythonOT:master Jun 21, 2022
@clecoz clecoz deleted the emd2_check_weights_equal_sum branch June 21, 2022 15:44
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