set_method_opt
- sherpa.astro.ui.set_method_opt(optname: str, val: Any) None
Set an option for the current optimization method.
This is a helper function since the optimization options can also be set directly using the object returned by
get_method.- Parameters:
optname (str) – The name of the option to set. The
get_methodandget_method_optroutines can be used to find out valid values for this argument.val – The new value for the option.
- Raises:
sherpa.utils.err.ArgumentErr – If the
optnameargument is not recognized.
See also
get_methodReturn an optimization method.
get_method_optReturn one or all options of the current optimization method.
set_methodChange the optimization method.
Examples
Change the
maxfevparameter for the current optimizer to 2000.>>> set_method_opt('maxfev', 2000)