Skip to content

Changing S(Q) selection with polydispersity active causes error and resets PD to gaussian #3248

@jack-rooks

Description

@jack-rooks

Describe the bug
When trying to fit 1D data (not replicated with theoretical data only) with a polydisperse radius and a structure factor the following error is given:
ERROR: Traceback (most recent call last): File "sas\qtgui\Perspectives\Fitting\FittingWidget.py", line 1800, in onPolyModelChange IndexError: list assignment index out of range
Which results in the polydispersity being changed to the default value (gaussian). Removing the structure factor results in the same error

To Reproduce
Steps to reproduce the behavior:

  1. Load some 1D data and send to fit
  2. Select Sphere, sphere for the model (also tested with cylinder, cylinder)
  3. Tick the box for polydipersity and mark the radius as fittable in the polydispersity tab
  4. Set polydispersity type to be not gaussian (tested with lognormal and schulz)
  5. Click the fit button (note, changing polydispersity to be non-zero without fitting is insufficient)
  6. Change your selection for structure factor (add or remove structure factor, tested with hardsphere, none, and hayter_msa)
  7. Observe error posted above and reversion of polydipersisty to default values

Expected behavior
Structure factor should be applied without affecting polydispersity

SasView version (please complete the following information):

  • Version: 5.0.4 and 6.0.1

Operating system (please complete the following information):

  • OS: Windows 10

Additional context
Model seems to not be relevant, just that structure factor is updated after a fit which included a polydispersity with a type other than gaussian. While this changes the PD type to gaussian, it does not enforce the default Nsigs value as would happen if you changed from lognormal (default of 80) to gaussian (default of 35) manually.

I was not able to reliably replicate it, but it seems after this error occurs, the PD type changes to gaussian on subsequent fits, even if the desired settings are restored after the error occurs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    DefectBug or undesirable behaviour

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions