Merge remote-tracking branch 'origin/master'

This commit is contained in:
Dominik Demuth 2023-11-29 19:35:31 +01:00
commit d146f4fe7e

View File

@ -393,8 +393,7 @@ class FitResult(Points):
def get_state(self):
state = super().get_state()
for attr in ['idx', 'fun_kwargs', 'nobs', 'nvar',
'islog', 'iscomplex', 'x_data', 'y_data']:
for attr in ['idx', 'fun_kwargs', 'nobs', 'nvar', 'we', 'islog', 'iscomplex', 'x_data', 'y_data']:
state[attr] = getattr(self, attr)
state['name'] = self._model_name
@ -412,6 +411,8 @@ class FitResult(Points):
@staticmethod
def set_state(state, **kwargs):
state['params'] = {k: Parameter.set_state(v) for k, v in state.pop('params').items()}
if 'we' not in state:
state['we'] = '?'
data = FitResult(**state)
return data
@ -440,6 +441,9 @@ class FitResult(Points):
return new_fit
def sub(self, x_values):
if self.func is None:
raise ValueError('no fit function available to calculate new y values')
part_functions = []
actual_mode = -1
if 'complex_mode' in self.fun_kwargs: