diff --git a/glotaran/analysis/optimize.py b/glotaran/analysis/optimize.py index 585e308b6..92a6cac97 100644 --- a/glotaran/analysis/optimize.py +++ b/glotaran/analysis/optimize.py @@ -100,8 +100,7 @@ def _calculate_penalty( penalties = [group.full_penalty for group in optimization_groups] - penalty = np.concatenate(penalties) if len(penalties) != 1 else penalties[0] - return penalty + return np.concatenate(penalties) if len(penalties) != 1 else penalties[0] def _create_result( diff --git a/glotaran/test/test_spectral_penalties.py b/glotaran/test/test_spectral_penalties.py index 0f8f5f289..6bebb8075 100644 --- a/glotaran/test/test_spectral_penalties.py +++ b/glotaran/test/test_spectral_penalties.py @@ -216,8 +216,7 @@ def test_equal_area_penalties(debug=False): # for both we perturb kinetic parameters a bit to give the optimizer some work pspec_wp = dict(deepcopy(pspec.base), **pspec.equal_area) pspec_wp["kinetic"] = [v * 1.01 for v in pspec_wp["kinetic"]] - pspec_wp.update({"i": [[1, {"vary": False}], 1]}) - + pspec_wp["i"] = [[1, {"vary": False}], 1] pspec_np = dict(deepcopy(pspec.base)) param_wp = ParameterGroup.from_dict(pspec_wp)