Repository: fitbenchmarking/fitbenchmarking

Issue:
Support for latest bumps
Bumps 0.9.0 now has different options:
- Rename mp option to lm
- Rename lm to scipy.leastsq

We should update our docs to point this out.
We should update our options.

Discussion:
github-actions[bot]: ## Unit & System Test Results
    4 files  ±0      4 suites  ±0   6m 18s [:stopwatch:](https://github.com/EnricoMi/publish-unit-test-result-action/blob/v1.20/README.md#the-symbols "duration of all tests") +14s
359 tests ±0  350 [:heavy_check_mark:](https://github.com/EnricoMi/publish-unit-test-result-action/blob/v1.20/README.md#the-symbols "passed tests") ±0    8 [:zzz:](https://github.com/EnricoMi/publish-unit-test-result-action/blob/v1.20/README.md#the-symbols "skipped / disabled tests") ±0  1 [:x:](https://github.com/EnricoMi/publish-unit-test-result-action/blob/v1.20/README.md#the-symbols "failed tests") ±0 
686 runs  ±0  637 [:heavy_check_mark:](https://github.com/EnricoMi/publish-unit-test-result-action/blob/v1.20/README.md#the-symbols "passed tests") ±0  48 [:zzz:](https://github.com/EnricoMi/publish-unit-test-result-action/blob/v1.20/README.md#the-symbols "skipped / disabled tests") ±0  1 [:x:](https://github.com/EnricoMi/publish-unit-test-result-action/blob/v1.20/README.md#the-symbols "failed tests") ±0 

For more details on these failures, see [this check](https://github.com/fitbenchmarking/fitbenchmarking/runs/6097532524).

Results for commit 4c353394. ± Comparison against base commit d4e10432.


Patch:
diff --git a/docs/source/users/options/minimizer_option.rst b/docs/source/users/options/minimizer_option.rst
index 6be2cd39..7ac082b8 100644
--- a/docs/source/users/options/minimizer_option.rst
+++ b/docs/source/users/options/minimizer_option.rst
@@ -29,13 +29,13 @@ FitBenchmarking currently supports the Bumps minimizers:
 
 * `Nelder-Mead Simplex <https://bumps.readthedocs.io/en/latest/guide/optimizer.html#nelder-mead-simplex>`__ (:code:`amoeba`)
 
-* `Levenberg-Marquardt <https://bumps.readthedocs.io/en/latest/guide/optimizer.html#fit-lm>`__  (:code:`lm`)
+* `Levenberg-Marquardt <https://bumps.readthedocs.io/en/latest/guide/optimizer.html#fit-lm>`__  (:code:`lm-bumps`) This is `mpfit`, a translation of `MINPACK` to Python.
 
 * `Quasi-Newton BFGS <https://bumps.readthedocs.io/en/latest/guide/optimizer.html#quasi-newton-bfgs>`__ (:code:`newton`)
 
 * `Differential Evolution <https://bumps.readthedocs.io/en/latest/guide/optimizer.html#differential-evolution>`__ (:code:`de`)
 
-* `MINPACK <https://github.com/bumps/bumps/blob/96b5100fc3d5b9485bd4a444c83a33617b74aa9d/bumps/mpfit.py>`__ (:code:`mp`)  This is a translation of `MINPACK` to Python.
+* `scipy's leastsq <https://bumps.readthedocs.io/en/latest/guide/optimizer.html#fit-lm>`__ (:code:`scipy-leastsq`)  This calls scipy's Levenberg-Marquardt method. Note that this was the default method for `lm` prior to Bumps v0.8.2.
 
 **Licence** The main licence file for Bumps is `here <https://github.com/bumps/bumps/blob/master/LICENSE.txt>`__.  Individual files have their own copyright and licence
 -- if you plan to incorporate this in your own software you should first check that the
@@ -52,7 +52,7 @@ The Bumps minimizers are set as follows:
            lm-bumps
            newton
            de
-           mp
+           scipy-leastsq
 
 .. warning::
    The additional dependency Bumps must be installed for this to be available;
diff --git a/examples/options_template.ini b/examples/options_template.ini
index 6e8b43e1..499ac611 100644
--- a/examples/options_template.ini
+++ b/examples/options_template.ini
@@ -11,7 +11,7 @@ max_runtime: 600
 [MINIMIZERS]
 
 bumps: lm-bumps
-       mp
+       scipy-leastsq
 
 dfo: dfogn
 
diff --git a/fitbenchmarking/controllers/bumps_controller.py b/fitbenchmarking/controllers/bumps_controller.py
index 8e794bcf..c76b6e4e 100644
--- a/fitbenchmarking/controllers/bumps_controller.py
+++ b/fitbenchmarking/controllers/bumps_controller.py
@@ -21,13 +21,13 @@ class BumpsController(Controller):
     """
 
     algorithm_check = {
-            'all': ['amoeba', 'lm-bumps', 'newton', 'de', 'mp'],
-            'ls': ['lm-bumps', 'mp'],
+            'all': ['amoeba', 'lm-bumps', 'newton', 'de', 'scipy-leastsq'],
+            'ls': ['lm-bumps', 'scipy-leastsq'],
             'deriv_free': ['amoeba', 'de'],
             'general': ['amoeba', 'newton', 'de'],
             'simplex': ['amoeba'],
-            'trust_region': ['lm-bumps'],
-            'levenberg-marquardt': ['lm-bumps'],
+            'trust_region': ['lm-bumps', 'scipy-leastsq'],
+            'levenberg-marquardt': ['lm-bumps', 'scipy-leastsq'],
             'gauss_newton': [],
             'bfgs': ['newton'],
             'conjugate_gradient': [],
@@ -120,6 +120,8 @@ class BumpsController(Controller):
 
         if self.minimizer == "lm-bumps":
             self.minimizer = "lm"
+        elif self.minimizer == "scipy-leastsq":
+            self.minimizer = "scipy.leastsq"
 
     def _check_timer_abort_test(self):
         """
diff --git a/fitbenchmarking/utils/options.py b/fitbenchmarking/utils/options.py
index 09a7972e..f6cc9430 100644
--- a/fitbenchmarking/utils/options.py
+++ b/fitbenchmarking/utils/options.py
@@ -19,7 +19,7 @@ class Options:
     VALID_SECTIONS = ['MINIMIZERS', 'FITTING', 'JACOBIAN', 'HESSIAN',
                       'PLOTTING', 'OUTPUT', 'LOGGING']
     VALID_MINIMIZERS = \
-        {'bumps': ['amoeba', 'lm-bumps', 'newton', 'de', 'mp'],
+        {'bumps': ['amoeba', 'lm-bumps', 'newton', 'de', 'scipy-leastsq'],
          'dfo': ['dfogn', 'dfols'],
          'gradient_free': ['HillClimbingOptimizer',
                            'RepulsingHillClimbingOptimizer',
@@ -102,7 +102,7 @@ class Options:
              'LOGGING': VALID_LOGGING}
 
     DEFAULT_MINIMZERS = \
-        {'bumps': ['amoeba', 'lm-bumps', 'newton', 'mp'],
+        {'bumps': ['amoeba', 'lm-bumps', 'newton', 'scipy-leastsq'],
          'dfo': ['dfogn', 'dfols'],
          'gradient_free': ['HillClimbingOptimizer',
                            'RepulsingHillClimbingOptimizer',
diff --git a/setup.py b/setup.py
index 9d3f5b4a..2ba2d03f 100644
--- a/setup.py
+++ b/setup.py
@@ -31,7 +31,7 @@ setup(name='FitBenchmarking',
                       'SAS': ['sasmodels',
                               'tinycc;platform_system==\'Windows\''],
                       'minuit': ['iminuit>=2.0'],
-                      'bumps': ['bumps'],
+                      'bumps': ['bumps>=0.9.0'],
                       'numdifftools': ['numdifftools'],
                       'levmar': ['levmar'],
                       'mantid': ['h5py>=2.10.0,<3', 'pyyaml>=5.4.1'],


Test patch:
diff --git a/fitbenchmarking/systests/linux_expected_results/default_parsers.txt b/fitbenchmarking/systests/linux_expected_results/default_parsers.txt
index 3b821c75..ccfa08bd 100644
--- a/fitbenchmarking/systests/linux_expected_results/default_parsers.txt
+++ b/fitbenchmarking/systests/linux_expected_results/default_parsers.txt
@@ -2,4 +2,4 @@
                      lm-bumps               Nelder-Mead lm-scipy: j:scipy 2-point
 cubic, Start 1  3.861e-22 (1)  6.267e-05 (1.623e+17)[1]             3.861e-22 (1)
 cubic, Start 2  3.861e-22 (1)     7.176e-11 (1.859e+11)             3.861e-22 (1)
-Problem Def 1     0.03188 (1)              inf (inf)[4]              inf (inf)[4]
\ No newline at end of file
+Problem Def 1     0.04303 (1)              inf (inf)[4]              inf (inf)[4]
diff --git a/fitbenchmarking/utils/tests/test_options_minimizers.py b/fitbenchmarking/utils/tests/test_options_minimizers.py
index f32e7091..3261bc77 100644
--- a/fitbenchmarking/utils/tests/test_options_minimizers.py
+++ b/fitbenchmarking/utils/tests/test_options_minimizers.py
@@ -28,7 +28,7 @@ class MininimizerOptionTests(unittest.TestCase):
         """
         Checks valid bumps minimizers are set correctly
         """
-        expected = ['amoeba', 'lm-bumps', 'newton', 'mp']
+        expected = ['amoeba', 'lm-bumps', 'newton', 'scipy-leastsq']
         actual = self.options.minimizers['bumps']
         self.assertEqual(expected, actual)