def __init__(self, errorMeasureClass, errorMeasureInitializationParameters=None, precision=-1):
        """Initializes the optimization method.

        :param BaseErrorMeasure errorMeasureClass:    Error measure class from :py:mod:`pycast.errors`.
        :param dictionary errorMeasureInitializationParameters:    Parameters used to initialize
            the errorMeasureClass. This dictionary will be passed to the errorMeasureClass as \*\*kwargs.
        :param integer precision:    Defines the accuracy for parameter tuning in 10^precision.
            This parameter has to be an integer in [-7, 0].

        :raise:    Raises a :py:exc:`TypeError` if errorMeasureClass is not a valid class.
            Valid classes are derived from :py:class:`pycast.errors.BaseErrorMeasure`.
        :raise:    Raises a :py:exc:`ValueError` if precision is not in [-7, 0].
        """

        if errorMeasureInitializationParameters is None:
            errorMeasureInitializationParameters = {}

        if not isinstance(errorMeasureClass, (type, types.ClassType)):
            raise TypeError("errorMeasureClass has to be of type pycast.errors.BaseErrorMeasure or of an inherited class.")
        if not issubclass(errorMeasureClass, BaseErrorMeasure):
            raise TypeError("errorMeasureClass has to be of type pycast.errors.BaseErrorMeasure or of an inherited class.")
        if not -7 <= precision <= 0:
            raise ValueError("precision has to be in [-7,0].")

        super(BaseOptimizationMethod, self).__init__()

        self._precison   = int(precision)
        self._errorClass = errorMeasureClass
        self._errorMeasureKWArgs = errorMeasureInitializationParameters
def __init__ ( self , errorMeasureClass , errorMeasureInitializationParameters = None , precision = - 1 ) : if errorMeasureInitializationParameters is None : errorMeasureInitializationParameters = { } if not isinstance ( errorMeasureClass , ( type , types . ClassType ) ) : raise TypeError ( "errorMeasureClass has to be of type pycast.errors.BaseErrorMeasure or of an inherited class." ) if not issubclass ( errorMeasureClass , BaseErrorMeasure ) : raise TypeError ( "errorMeasureClass has to be of type pycast.errors.BaseErrorMeasure or of an inherited class." ) if not - 7 <= precision <= 0 : raise ValueError ( "precision has to be in [-7,0]." ) super ( BaseOptimizationMethod , self ) . __init__ ( ) self . _precison = int ( precision ) self . _errorClass = errorMeasureClass self . _errorMeasureKWArgs = errorMeasureInitializationParameters
Initializes the optimization method.

        :param BaseErrorMeasure errorMeasureClass:    Error measure class from :py:mod:`pycast.errors`.
        :param dictionary errorMeasureInitializationParameters:    Parameters used to initialize
            the errorMeasureClass. This dictionary will be passed to the errorMeasureClass as \*\*kwargs.
        :param integer precision:    Defines the accuracy for parameter tuning in 10^precision.
            This parameter has to be an integer in [-7, 0].

        :raise:    Raises a :py:exc:`TypeError` if errorMeasureClass is not a valid class.
            Valid classes are derived from :py:class:`pycast.errors.BaseErrorMeasure`.
        :raise:    Raises a :py:exc:`ValueError` if precision is not in [-7, 0].