From 616b186e7b65b24eb4157a3d843de4c1e6ed5160 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Thu, 7 Feb 2019 07:49:05 +0100 Subject: _try_fits: Do not throw error when encountering insufficient data for fitting --- lib/dfatool.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'lib') diff --git a/lib/dfatool.py b/lib/dfatool.py index 9653017..3048f43 100755 --- a/lib/dfatool.py +++ b/lib/dfatool.py @@ -696,6 +696,14 @@ def _try_fits(by_param, state_or_tran, model_attribute, param_index, safe_functi median_measures = aggregate_measures(np.median(Y), Y) ref_results['median'].append(median_measures['rmsd']) + if not len(ref_results['mean']): + # Insufficient data for fitting + return { + 'best' : None, + 'best_rmsd' : np.inf, + 'results' : results, + } + best_fit_val = np.inf best_fit_name = None for function_name, result in raw_results.items(): -- cgit v1.2.3