From 9447b0c8838c443c72d8cf259c494f29fde1fa3e Mon Sep 17 00:00:00 2001 From: Janos Gabler Date: Sun, 13 Aug 2023 11:34:16 +0200 Subject: [PATCH] Fix. --- src/estimagic/parameters/parameter_groups.py | 1 - tests/optimization/test_tao_optimizers.py | 20 ++++++++++---------- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/src/estimagic/parameters/parameter_groups.py b/src/estimagic/parameters/parameter_groups.py index 1cf06c80b..cba3cb536 100644 --- a/src/estimagic/parameters/parameter_groups.py +++ b/src/estimagic/parameters/parameter_groups.py @@ -38,7 +38,6 @@ def get_params_groups_and_short_names(params, free_mask, max_group_size=8): if len(pd.unique(groups)) == len(groups): groups = ["Parameters"] * len(groups) - groups = groups counts = pd.value_counts(groups) to_be_split = counts[counts > max_group_size] for group_name, n_occurrences in to_be_split.items(): diff --git a/tests/optimization/test_tao_optimizers.py b/tests/optimization/test_tao_optimizers.py index c6169d956..984bdc350 100644 --- a/tests/optimization/test_tao_optimizers.py +++ b/tests/optimization/test_tao_optimizers.py @@ -78,7 +78,7 @@ def test_max_iters(): algo_options={"stopping.max_iterations": 25}, ) - assert result.message == "user defined" or result.message == "step size small" + assert result.message in ("user defined", "step size small") def test_grtol(): @@ -99,9 +99,9 @@ def test_grtol(): }, ) - assert ( - result.message == "relative_gradient_tolerance below critical value" - or result.message == "step size small" + assert result.message in ( + "relative_gradient_tolerance below critical value", + "step size small", ) @@ -123,9 +123,9 @@ def test_gatol(): }, ) - assert ( - result.message == "absolute_gradient_tolerance below critical value" - or result.message == "step size small" + assert result.message in ( + "absolute_gradient_tolerance below critical value", + "step size small", ) @@ -147,9 +147,9 @@ def test_gttol(): }, ) - assert ( - result.message == "gradient_total_tolerance below critical value" - or result.message == "step size small" + assert result.message in ( + "gradient_total_tolerance below critical value", + "step size small", )