diff --git a/SWV_AnyPeakFinder/logic.py b/SWV_AnyPeakFinder/logic.py index 9fcb51c..5fedfa4 100644 --- a/SWV_AnyPeakFinder/logic.py +++ b/SWV_AnyPeakFinder/logic.py @@ -318,7 +318,7 @@ def _return_best_model( outcomes: list[FitResults] = [each(x, y, center) for each in models] # Find minimum chisqr and return that model - best_model: FitResults = min(outcomes, key=lambda x: x.chisqr) + best_model: FitResults = min(outcomes, key=lambda x: x.result.bic) return best_model