Changed print statement and added commentary
This commit is contained in:
@@ -10,7 +10,9 @@ import pandas as pd
|
|||||||
def get_convergence(
|
def get_convergence(
|
||||||
output_file_paths, molecule, crit_mean=0.01, crit_std=0.10
|
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:
|
if len(output_file_paths) < 2:
|
||||||
print("One iteration, therefore no convergence.")
|
print("One iteration, therefore no convergence.")
|
||||||
@@ -30,6 +32,7 @@ def get_convergence(
|
|||||||
older_std = older_fit_results[molecule].std()
|
older_std = older_fit_results[molecule].std()
|
||||||
measure_std = abs(abs(np.abs(newer_std) - abs(older_std))/norm)
|
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_mean <= crit_mean:
|
||||||
if measure_std <= crit_std:
|
if measure_std <= crit_std:
|
||||||
convergence = True
|
convergence = True
|
||||||
@@ -39,7 +42,8 @@ def get_convergence(
|
|||||||
print(
|
print(
|
||||||
"Convergence result for ", output_file_paths[-1], " and ",
|
"Convergence result for ", output_file_paths[-1], " and ",
|
||||||
output_file_paths[-2], "\n\t\t\t",
|
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
|
return convergence
|
||||||
|
|||||||
Reference in New Issue
Block a user