Skip to content

Commit

Permalink
Merge pull request #486 from LAndersen1/patch-1
Browse files Browse the repository at this point in the history
Fixing get_corrstd for small system changes
  • Loading branch information
Valdes-Tresanco-MS committed Apr 19, 2024
2 parents 41448f5 + a51dadf commit 6ff56c9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions GMXMMPBSA/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ def get_std(val1, val2):


def get_corrstd(val1, val2):
return sqrt(val1 ** 2 + val2 ** 2 - 2 * val1 * val2)
return sqrt(max(0, val1 ** 2 + val2 ** 2 - 2 * val1 * val2))


def calc_sum(vector1, vector2, mut=False) -> (float, float):
Expand Down Expand Up @@ -915,4 +915,4 @@ def _get_energy_gbnsr6(results_section):
c += 1
if c == len(results_section):
break
return energy
return energy

0 comments on commit 6ff56c9

Please sign in to comment.