@paramsarray.setter<EOL><INDENT>def paramsarray(self, value):<DEDENT>
nparams = len(self._index_to_param)<EOL>assert (isinstance(value, scipy.ndarray) and value.ndim == <NUM_LIT:1>), (<EOL>"<STR_LIT>")<EOL>assert len(value) == nparams, ("<STR_LIT>"<EOL>"<STR_LIT>")<EOL>if (self._paramsarray is not None) and all(value == self._paramsarray):<EOL><INDENT>return <EOL><DEDENT>newvalues = {}<EOL>vectorized_params = {}<EOL>for (i, param) in self._index_to_param.items():<EOL><INDENT>if isinstance(param, str):<EOL><INDENT>newvalues[param] = float(value[i])<EOL><DEDENT>elif isinstance(param, tuple):<EOL><INDENT>(iparam, iparamindex) = param<EOL>if iparam in vectorized_params:<EOL><INDENT>assert iparamindex not in vectorized_params[iparam]<EOL>vectorized_params[iparam][iparamindex] = float(value[i])<EOL><DEDENT>else:<EOL><INDENT>vectorized_params[iparam] = {iparamindex:float(value[i])}<EOL><DEDENT><DEDENT>else:<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT><DEDENT>for (param, paramd) in vectorized_params.items():<EOL><INDENT>assert set(paramd.keys()) == set(range(len(paramd)))<EOL>newvalues[param] = scipy.array([paramd[i] for i in range(len(paramd))],<EOL>dtype='<STR_LIT:float>')<EOL><DEDENT>self.updateParams(newvalues)<EOL>self._paramsarray = self.paramsarray<EOL>
Set new `paramsarray` and update via `updateParams`.