fitbenchmarking.controllers.mantid_controller module

Implements a controller for the Mantid fitting software.

class fitbenchmarking.controllers.mantid_controller.MantidController(problem)

Bases: fitbenchmarking.controllers.base_controller.Controller

Controller for the Mantid fitting software.

Mantid requires subscribing a custom function in a predefined format, so this controller creates that in setup.

cleanup()

Convert the result to a numpy array and populate the variables results will be read from.

eval_chisq(params, x=None, y=None, e=None)

Computes the chisq value. If multi-fit inputs will be lists and this will return a list of chi squared of params[i], x[i], y[i], and e[i].

Parameters:
  • params (list of float or list of list of float) – The parameters to calculate residuals for
  • x (numpy array or list of numpy arrays, optional) – x data points, defaults to self.data_x
  • y (numpy array or list of numpy arrays, optional) – y data points, defaults to self.data_y
  • e (numpy array or list of numpy arrays, optional) – error at each data point, defaults to self.data_e
Returns:

The sum of squares of residuals for the datapoints at the given parameters

Return type:

numpy array

fit()

Run problem with Mantid.

setup()

Setup problem ready to run with Mantid.

Adds a custom function to Mantid for calling in fit().