-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Various Multiplicity Model Fixes #2647
Conversation
… is always added to the proper row
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good. Basic functionality checked. Multishell models serialize and deserialize properly.
Response to the shell combobox is as expected but we still lose the previously entered values on shell change. Should this be addressed? I believe it was mentioned as a bug in one of the issues.
Built locally using 2369-multiplicity-copy and newmodels0923, I am happy so far, well done Jeff for fixing this. core-multi-shell with one shell now gives same fitting result as core-shell-sphere, including polydisp on core radius and hard sphere S(Q) core-multi-shell-cylinder with one shell now gives same fitting result as core-shell-cylinder, including with S(Q), and with reasonably close results with 3 or 4 polydispersity distributions (though understandably a bit slow to compute) [ Also - when I have the same data in more than one fit tab and use S(Q) the saving of P(Q) and S(Q) in the data explorer replaces previous one from another tab, which it ought not to.] [Also there the new dropdown in "send to" for "replace" data in current fit tab is not working for me, the dropdown has only the one choice] |
The dropdown does replace if you select the only option, and normal send to if you just click the main button. |
To answer the question at today's call by @butlerpd, this does not fix the issue related to the RPA model. |
I need to find some time to do some more testing, and also to merge my newmodels0923 branches with more recent changes. One of my new models, the lamellar_x5_ one, which is not a multiplicity model, is prone to giving overflows & underflows, especially if using L-M fitting. When this happens the I(Q) in the data explorer comes back all as nan or inf. In my local build it seems that (a) no error messages appear anywhere, (b) the model (or perhaps rather the comms with the gui) seems then to be corrupted, failing to work properly from that point onward, even with calculations that I know ought to work. Testing simple forwards calculations of the I(Q) from the model using the "compare" py script suggests the model itself is behaving correctly. Need to to some more testing, perhaps make a temporary model that can be deliberately failed by a change of parameter value. UPDATE - 13h Oct. Having pulled latest changes to the sasview part of my local win build, I am fairly convinced that the odd issues with lamellar_x5 are likely due to the imposed zero to inf range limit on the parameter values. I have still all zero I(Q) returning some times, but starting from a different set of parameter values the calculations and fits then work OK. A bit odd, but paracrystal models are always rather picky, I will now do some more testing on an actual multiplicity model. |
My concern about the RPA not working is whether this is because the fix is not really correct, i.e. the special parameter is not being interpreted as defined. If however it is just a case of extra code needed to fully implement the use of the special parameter I'm good with calling this an improvement and move forward approving. @krzywon has agreed to look into this. |
I don't know if this is unrelated to this branch, but I had to add an 'import subprocess' to the file convertUI.py to make it work. |
The latest merge commit should fix this.
This is one of the items I was going to ticket from #1089. It's apparently been around for a while.
Very annoying. I'm looking into this now. |
Final update:
This should now be fixed using a simple copy-paste of parameters.
I can reliably recreate this in v5.0.6 (and maybe spent too much time trying to debug this). It appears to be related to simultaneous signals that cause conflicting behavior. I'll add more in the issue, but this has been around a while, is not related to this PR, and could be a complex fix. |
For clarity during a review, here are the issues this PR fixes or improves:
And issues this PR does not fix:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Everything that this PR claims to fix (which is not everything to do with multiplicity) seems to work as advertised save one thing which is still mostly fixed. However this is a great improvement over 5.x so the issues noted below should not prevent merging as necessary. That said here is what I found on windows 10:
- A sum model that contains a layered model with no SLD does NOT suppress the SLD profile which will throw an error if pressed. The suppression does seem to work in all other cases.
- Loading a multi SLD (but not a multiplicity that does not contain SLD such as the
unified_power_Rg
model) throws a warning pop-up saying “Clipboard content is incompatible with the fit page.” This also happened after playing with thecore_mutli_shell
model and then adding a HS structure factor. As soon as the structure factor was chosen the pop-up occurred. It is almost as if choosing a model when it is an SLD profile model automatically tries to get something from the clipboard? - Finally, while the Copy parameters seems to work (as does Copy paste from a multiplicity model to another model), I notice that the table created includes extraneous parameters like the name of the model (and
multiplicity
in the case it is) This is clearly not part of this PR but is annoying I think? - The other part of the Copy parameters which again is not likely to be part of the PR is that the TRUE FALSE flags for whether a parameter is being fit do NOT align. That seems to be true regardless of multiplicity or not.
This is now fixed. I don't plan to fix the other issues noted here in this PR. |
This appears to fix both the first AND second points above. Not sure why? but I'll take it. However .... I do not understand why the |
…ter is a number greater than 0. This eliminates magnetic SLDs that end in 0
Right ... color me totally confused. This final fix now allows the onion model's SLD profile to be shown along with others and now that SLD profile is suppressed for non SLD multiplicity models even in sum/multiply, the ERROR: SLD profile calculation failed. I thought we checked that and it was working before? but looking at the code I'm not sure that is possible. It is the same error reported by @gonzalezma earlier and seems to come from the call to def onShowSLDProfile(self):
"""
Show a quick plot of SLD profile
"""
# get profile data
try:
x, y = self.kernel_module.getProfile()
except TypeError:
msg = "SLD profile calculation failed."
logging.error(msg)
return Should we just suppress the profile for all mixture models? On the other hand, I think all the issues identified by @smk78 which led him to request changes have been addressed from my testing so that block on merging should be removed I think. |
The SLD calculation error is one of the items I listed as 'not going to fix' in this PR. It's present in v5.0.6, so not something I introduced here. |
Fair enough - Pencils down you are telling me :-). I was wondering about just disabling the button for all mixture models but then maybe that will just make us forget about the problem (out of sight out of mind?). In which case we should be ready to merge IMO |
Description
This fixes a number of multiplicity issues including addition of models in the sum|multi custom combo boxes, copy/paste of parameters, copy to excel/latex files, linking to structure factors, and suppressing the
SLD profile
button for models without SLD parameters.Fixes #1089
Fixes #1897
Fixes #2369
Fixes #2563
How Has This Been Tested?
Tested locally using the
core_multi_shell
,onion
, andunified_power_Rg
built-in models as well as thecore_multi_shell_cylinder
model from sasmodels->newmodles0923.Review Checklist (please remove items if they don't apply):