FitManager: make uncertainty trigger the use of weighted fit#4591
FitManager: make uncertainty trigger the use of weighted fit#4591kif wants to merge 8 commits intosilx-kit:mainfrom
Conversation
|
From what I understand, your fix doe not correspond to the -> If weight flag is False, uncertainties should be ignored... |
|
|
| self.sigmay = ( | ||
| numpy.array(sigmay) if self.fitconfig["WeightFlag"] else None | ||
| ) | ||
| self.fitconfig["WeightFlag"] = True |
There was a problem hiding this comment.
Then maybe good to add to the setdata docstring that setting sigmay enables WeightFlag. I agree it is expected but since there looks to be a few ways to set this best to make it explicit.
Did you check how this works from the fit widgets?
There was a problem hiding this comment.
No, I did not check it ... BTW, I doubt this code is used anywhere since the "split Pseudo-Voigt 2" mode could not work at all, since array are not initialized at the proper size.
The code-style is very PyMca-like, fit results would deserve to be dataclass or namedtuple instances, but this is not the use-case for this PR.
There was a problem hiding this comment.
The code-style is very PyMca-like, fit results would deserve to be dataclass or namedtuple instances, but this is not the use-case for this PR.
I would prefer the expression "pre python2.6" (released in October 2008). PyMca could not use something that was not existing when it was written.
|
I just checked, the GUI still works, and the bug about "Split pseudo-Voigt 2" is gone with this PR. |
t20100
left a comment
There was a problem hiding this comment.
Thanks for checking the GUI and for looking into this!
Two minor comments, otherwise LGTM
BTW, I doubt this code is used anywhere
Provided the issues you fixed, probably...
| class VersionInfo(NamedTuple): | ||
| major: int | ||
| minor: int | ||
| micro: int | ||
| releaselevel: str | ||
| serial: int | ||
|
|
||
| version_info = _version_info(MAJOR, MINOR, MICRO, RELEV, SERIAL) | ||
|
|
||
| version_info = VersionInfo(MAJOR, MINOR, MICRO, RELEV, SERIAL) |
There was a problem hiding this comment.
Let's keep it private:
| class VersionInfo(NamedTuple): | |
| major: int | |
| minor: int | |
| micro: int | |
| releaselevel: str | |
| serial: int | |
| version_info = _version_info(MAJOR, MINOR, MICRO, RELEV, SERIAL) | |
| version_info = VersionInfo(MAJOR, MINOR, MICRO, RELEV, SERIAL) | |
| class _VersionInfo(NamedTuple): | |
| major: int | |
| minor: int | |
| micro: int | |
| releaselevel: str | |
| serial: int | |
| version_info = _VersionInfo(MAJOR, MINOR, MICRO, RELEV, SERIAL) |
Co-authored-by: Thomas VINCENT <thomas.vincent@esrf.fr>
related to #4590
<Module or Topic>: <Action> <Summary>(see contributing guidelines)PR summary
More intuitive handling of uncertainties
AI Disclosure