Compare commits
2 Commits
23587b775e
...
9c5ba3d860
| Author | SHA1 | Date | |
|---|---|---|---|
| 9c5ba3d860 | |||
| b599062322 |
@@ -10,7 +10,9 @@ import pandas as pd
|
||||
def get_convergence(
|
||||
output_file_paths, molecule, crit_mean=0.01, crit_std=0.10
|
||||
):
|
||||
"""Function checks if last two files contain converging datasets."""
|
||||
"""Function checks if data results from last two
|
||||
files contain are within convergence criteria.
|
||||
Returns Boolean"""
|
||||
|
||||
if len(output_file_paths) < 2:
|
||||
print("One iteration, therefore no convergence.")
|
||||
@@ -30,6 +32,7 @@ def get_convergence(
|
||||
older_std = older_fit_results[molecule].std()
|
||||
measure_std = abs(abs(np.abs(newer_std) - abs(older_std))/norm)
|
||||
|
||||
# check if results within convergence criteria
|
||||
if measure_mean <= crit_mean:
|
||||
if measure_std <= crit_std:
|
||||
convergence = True
|
||||
@@ -39,7 +42,8 @@ def get_convergence(
|
||||
print(
|
||||
"Convergence result for ", output_file_paths[-1], " and ",
|
||||
output_file_paths[-2], "\n\t\t\t",
|
||||
measure_mean, measure_std, "convergence: ", str(convergence)
|
||||
round(measure_mean, 4), round(measure_std, 4),
|
||||
"convergence: ", str(convergence)
|
||||
)
|
||||
|
||||
return convergence
|
||||
|
||||
Reference in New Issue
Block a user