[BUG] Accept Fit from Nested Functions #277

Closed
opened 2024-07-04 08:28:06 +00:00 by saeckech · 0 comments
Member

Current behavior

I have a fitmodel according to: Const+(Const*SpecDens) (see also screenshot). The checkbox-preview option below the initial fitparameters works fine. Also the preview in the fit results after "run fit" seems to work, however, when accepting the fit results, the (partial) functions are not plotted. There is a message in the error log instead, see 'Initial Error Message' below. Everything, including plotting partial functions, works fine if I delete the scaling factor, i.e. for Const+SpecDens.

When I tried to reintroduce the scaling factor, I cannot even generate a checkbox-preview, instead another error message appeared, see 'Second Error Message' below.

Version

2024-06-24

Expected behavior

No response

Steps to reproduce

No response

Log messages

Initial Error Message:
2024-07-04 10:16:05,692 - ERROR - Uncaught exception:
Traceback (most recent call last):
  File "/tmp/.mount_NMRevaljv2M0/usr/src/gui_qt/main/mainwindow.py", line 981, in accepts_fit
    self.fit_dialog.set_parameter(res)
  File "/tmp/.mount_NMRevaljv2M0/usr/src/gui_qt/fit/fitwindow.py", line 487, in set_parameter
    self.set_parameter_iter(fit_id, [p.value for p in fit_parameter], self.models[fitted_model])
  File "/tmp/.mount_NMRevaljv2M0/usr/src/gui_qt/fit/fitwindow.py", line 496, in set_parameter_iter
    cnt += self.param_widgets[model_p['cnt']].set_parameter(fit_id, param[cnt:])
  File "/tmp/.mount_NMRevaljv2M0/usr/src/gui_qt/fit/fit_parameter.py", line 286, in set_parameter
    new_param[i] = parameter[i]
IndexError: list index out of range

Second Error Message:
2024-07-04 10:25:07,528 - ERROR - Uncaught exception:
Traceback (most recent call last):
  File "/tmp/.mount_NMRevaljv2M0/usr/src/gui_qt/main/mainwindow.py", line 957, in show_fit_preview
    self.fit_dialog.make_previews(x, funcs)
  File "/tmp/.mount_NMRevaljv2M0/usr/src/gui_qt/fit/fitwindow.py", line 455, in make_previews
    y = f.func(x, *p_value, **kwargs)
  File "/tmp/.mount_NMRevaljv2M0/usr/src/nmreval/fit/_meta.py", line 184, in func
    pl, kw_left = self._left_arguments(*args, **kwargs)
  File "/tmp/.mount_NMRevaljv2M0/usr/src/nmreval/fit/_meta.py", line 162, in _left_arguments
    kw_left[k_int] = kwargs[k_ext]
KeyError: 'xaxis_0'

Anything else?

No response

### Current behavior I have a fitmodel according to: Const+(Const*SpecDens) (see also screenshot). The checkbox-preview option below the initial fitparameters works fine. Also the preview in the fit results after "run fit" seems to work, however, when accepting the fit results, the (partial) functions are not plotted. There is a message in the error log instead, see 'Initial Error Message' below. Everything, including plotting partial functions, works fine if I delete the scaling factor, i.e. for Const+SpecDens. When I tried to reintroduce the scaling factor, I cannot even generate a checkbox-preview, instead another error message appeared, see 'Second Error Message' below. ### Version 2024-06-24 ### Expected behavior _No response_ ### Steps to reproduce _No response_ ### Log messages ```shell Initial Error Message: 2024-07-04 10:16:05,692 - ERROR - Uncaught exception: Traceback (most recent call last): File "/tmp/.mount_NMRevaljv2M0/usr/src/gui_qt/main/mainwindow.py", line 981, in accepts_fit self.fit_dialog.set_parameter(res) File "/tmp/.mount_NMRevaljv2M0/usr/src/gui_qt/fit/fitwindow.py", line 487, in set_parameter self.set_parameter_iter(fit_id, [p.value for p in fit_parameter], self.models[fitted_model]) File "/tmp/.mount_NMRevaljv2M0/usr/src/gui_qt/fit/fitwindow.py", line 496, in set_parameter_iter cnt += self.param_widgets[model_p['cnt']].set_parameter(fit_id, param[cnt:]) File "/tmp/.mount_NMRevaljv2M0/usr/src/gui_qt/fit/fit_parameter.py", line 286, in set_parameter new_param[i] = parameter[i] IndexError: list index out of range Second Error Message: 2024-07-04 10:25:07,528 - ERROR - Uncaught exception: Traceback (most recent call last): File "/tmp/.mount_NMRevaljv2M0/usr/src/gui_qt/main/mainwindow.py", line 957, in show_fit_preview self.fit_dialog.make_previews(x, funcs) File "/tmp/.mount_NMRevaljv2M0/usr/src/gui_qt/fit/fitwindow.py", line 455, in make_previews y = f.func(x, *p_value, **kwargs) File "/tmp/.mount_NMRevaljv2M0/usr/src/nmreval/fit/_meta.py", line 184, in func pl, kw_left = self._left_arguments(*args, **kwargs) File "/tmp/.mount_NMRevaljv2M0/usr/src/nmreval/fit/_meta.py", line 162, in _left_arguments kw_left[k_int] = kwargs[k_ext] KeyError: 'xaxis_0' ``` ### Anything else? _No response_
saeckech added the
Kind/Bug
label 2024-07-04 08:28:06 +00:00
dominik self-assigned this 2024-07-04 10:38:19 +00:00
dominik added the
Type/Fit
label 2024-07-04 10:38:30 +00:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: IPKM/nmreval#277
No description provided.