Skip to content
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

Npts and Nsigma issue in polydisperse distributions #2741

Closed
AnitaZhang0526 opened this issue Jan 18, 2024 · 2 comments
Closed

Npts and Nsigma issue in polydisperse distributions #2741

AnitaZhang0526 opened this issue Jan 18, 2024 · 2 comments
Assignees
Labels
Critical High priority Defect Bug or undesirable behaviour SasView 6.0.0 Required for 6.0.0 release

Comments

@AnitaZhang0526
Copy link

Describe the bug
Parameters npts and nsigma do not seem to be used correctly. Only the default values (npts=35, nsigma=3) produce the expected results. Overriding those values currently creates wrong distributions and in turn results in wrong fittings on data.
See examples in the screenshots below. It seems like if the last parameter changed is PD[ratio] instead of npts or nsigma, the distribution will just be plotted with default values (like in Figure 5), but if the last parameter changed is npts or nsigma, a completely wrong distribution with a seemingly random number of points will be generated.

To Reproduce
Steps to reproduce the behavior:

  1. Go to any shape-dependent model with polydispersity option checked
  2. Changing npts and nsigma will produce errors in the shape of the distribution and the number of points used to plot the distribution.
  3. Click 'Compute/plot'

Expected behavior
The distribution should appear correctly based on nsigma with the number of points specified by npts.

Screenshots
Figure 1:
Screenshot 2024-01-18 104911
Figure 2:
Screenshot 2024-01-18 105124
Figure 3:
Screenshot 2024-01-18 105221
Figure 4:
Screenshot 2024-01-18 105649
Figure 5:
Screenshot 2024-01-18 105843

SasView version (please complete the following information):

  • Version:6.0.0a1

Operating system (please complete the following information):

  • OS: Windows 11

Additional context
@murphyryanp discovered this issue initially. We think the problem could be in the sasview repo or the sasmodels repo. In sasview, the most recent updates that can affect this are in FittingWidget.py. In sasmodels, it seems like there's an update to the direct_model.py that changes how npts is calculated, but unclear if it's really any different from the older version.

@AnitaZhang0526 AnitaZhang0526 added Defect Bug or undesirable behaviour Critical High priority labels Jan 18, 2024
@caitwolf
Copy link
Contributor

@butlerpd @krzywon I just ran across this bug myself in version 6.0.0b2 (Windows 10) during summer school. I was in the process of making a new issue then realized there was an existing one from Anita on the alpha version. I confirmed that this issue did not appear in 5.0.6.

@krzywon krzywon added the SasView 6.0.0 Required for 6.0.0 release label Jul 22, 2024
@krzywon
Copy link
Contributor

krzywon commented Jul 25, 2024

I think I finally found the issue. Any change to any polydispersity parameter (ratio, min, max, npts, nsigs) modifies the width/PD[ratio] value of the underlying model. The other values remain as the default values, regardless of what is shown in the table.

I hope to have a fix for this soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Critical High priority Defect Bug or undesirable behaviour SasView 6.0.0 Required for 6.0.0 release
Projects
None yet
Development

No branches or pull requests

5 participants