plumed2 icon indicating copy to clipboard operation
plumed2 copied to clipboard

Fixed division by zero when SIGMA_MEAN0=0 in Metainference

Open hmcezar opened this issue 3 years ago • 1 comments

Description

This PR fixes #847.

I'm not happy with the ifs inside the loops, and fixing this would be easy for the SP versions, but for SPE there might be zeros for just some of the replicas, so I'm not sure what would be a good approach in this case.

Let me know if you have any better ideas.

Target release

I would like my code to appear in release 2.7

Type of contribution
  • [X] changes to code or doc authored by PLUMED developers, or additions of code in the core or within the default modules
  • [ ] changes to a module not authored by you
  • [ ] new module contribution or edit of a module authored by you
Copyright
  • [X] I agree to transfer the copyright of the code I have written to the PLUMED developers or to the author of the code I am modifying.
  • [ ] the module I added or modified contains a COPYRIGHT file with the correct license information. Code should be released under an open source license. I also used the command cd src && ./header.sh mymodulename in order to make sure the headers of the module are correct.
Tests
  • [ ] I added a new regtest or modified an existing regtest to validate my changes.
  • [X] I verified that all regtests are passed successfully on GitHub Actions.

hmcezar avatar Aug 10 '22 15:08 hmcezar

Codecov Report

Merging #848 (ef04605) into master (beaf4e6) will not change coverage. The diff coverage is n/a.

:exclamation: Current head ef04605 differs from pull request most recent head 76e400e. Consider uploading reports for the commit 76e400e to get more accurate results

@@           Coverage Diff           @@
##           master     #848   +/-   ##
=======================================
  Coverage   85.84%   85.84%           
=======================================
  Files         600      600           
  Lines       49445    49445           
=======================================
  Hits        42447    42447           
  Misses       6998     6998           
Impacted Files Coverage Δ
src/isdb/Metainference.cpp 83.41% <ø> (ø)
src/isdb/MetainferenceBase.cpp 84.58% <ø> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

codecov-commenter avatar Aug 10 '22 16:08 codecov-commenter

Thanks!

carlocamilloni avatar Aug 26 '22 12:08 carlocamilloni

No problem @carlocamilloni ! If possible, just backport it to 2.7 and 2.8 please :smile:

hmcezar avatar Aug 26 '22 12:08 hmcezar