Compare commits
2 Commits
23587b775e
...
9c5ba3d860
| Author | SHA1 | Date | |
|---|---|---|---|
| 9c5ba3d860 | |||
| b599062322 |
@@ -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
|
||||||
|
|||||||
2
setup.py
2
setup.py
@@ -1,7 +1,7 @@
|
|||||||
from setuptools import setup
|
from setuptools import setup
|
||||||
|
|
||||||
setup(name='fsl_mrs_mce',
|
setup(name='fsl_mrs_mce',
|
||||||
version='0.0.2',
|
version='0.0.21',
|
||||||
description='A fsl_mrs Moncte Carlo estimation approach',
|
description='A fsl_mrs Moncte Carlo estimation approach',
|
||||||
url='https://git.thoffbauer.de/konstantin.bosbach/fsl_mrs_mce.git',
|
url='https://git.thoffbauer.de/konstantin.bosbach/fsl_mrs_mce.git',
|
||||||
author='Konstantin E Bosbach',
|
author='Konstantin E Bosbach',
|
||||||
|
|||||||
Reference in New Issue
Block a user