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

Doc Update: Polydispersity #1938

Merged
merged 9 commits into from
Nov 9, 2021
Merged

Doc Update: Polydispersity #1938

merged 9 commits into from
Nov 9, 2021

Conversation

smk78
Copy link
Contributor

@smk78 smk78 commented Oct 28, 2021

This PR attempts to address some of the documentation deficiencies in SasView raised in #1839. There is a wider reporting issue that would require coding changes which is not addressed here.

Work so far:

  • actually mention polydispersity under Single Fit in fitting_help.rst (Yup, we really didn't tell Users they could have polydisperse parameters!)
  • add some images
  • mention GPU

@smk78 smk78 self-assigned this Oct 28, 2021
@smk78 smk78 added the Documentation Concerns documentation label Oct 28, 2021
@smk78 smk78 added this to the SasView 5.0.5 milestone Oct 28, 2021
@smk78 smk78 changed the title WIP: Doc Update: Polydispersity Doc Update: Polydispersity Oct 28, 2021
@smk78
Copy link
Contributor Author

smk78 commented Oct 28, 2021

I think some additions are now needed to polydispersity.rst in Sasmodels. But that will have to be a separate PR.

Copy link
Member

@butlerpd butlerpd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OMG!!! this rst is HUUUGE 😄 with a number of things that need updating by the looks of it from just a quick skim. It is hard to keep these uptodate sometimes. I am wondering if we need to think about breaking this up somehow into several sub pages, both for the benefit of the user and for maintenance?

That said the PD addition seems correct and complete so I approve the PR for merging

@butlerpd
Copy link
Member

I note however that this has conflicting changes in fitting_help.rst blocking an actual merge. This will have to be resolved before we can merge it.

particular, pay attention to the Suggested Applications and Usage Notes therein.
Note that SasView defaults to Gaussian distributions, but these will not always
be the best choice. Also, the definition of *PD[ratio]* varies depending on
the chosen distribution!
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PD for orientation is absolute; PD for volume parameters are relative to the current value. It doesn't depend on the chosen distribution, though the meaning of center and width does (first and second moments was a good analytic choice, but it sure was confusing for rectangular distributions).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @pkienzle . Have changed it to read now:

image


.. image:: pd_tab.png

For more information, see the descriptions of :ref:`polydispersityhelp` . In
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Neither here nor the polydispersity docs mention that the distribution is a number density distribution, not a particle volume distribution. This is discussed in fitting_sq.rst and can be linked as PStheory.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, it does say in polydispersity.rst:

image

I've now also added a note to the same effect in fitting_help.rst.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably better to phrase this as These are all implemented as number densities. The resulting scattering is the number average from the different-sized particles., but that would be a sasmodels PR.

Within the current text you may want to mention the ability to reparameterize the particle so that you can control polydispersity according to within-particle constraints (link to plugin.rst). For example, if the process which generates the particles constrains the aspect ratio but not the volume, or if it is a squishy particle that preserves volume but allows a range of aspect ratios for each volume. You may need to define your own distribution function to fully describe the model (link to polydispersity.rst user defined functions).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have fielded several questions from users about the details of the polydispersity calculation, which is why I suggest linking to PStheory in fitting_sq.rst.

This file also discusses the relationship between scale, volume fraction, effective radius, effective radius mode and structure factor mode, which is useful information for the discussion of interaction and mixture models. I think there was an attempt to link to it in on line 105 of this file:

Also see :ref:`Interaction_and_Mixture_Models` for further information.

but it is self-referential! Please change it to ref Interaction_Models, which is the label used in fitting_sq.rst.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still tweaking the "number-average" phrase. The distributions are implemented as simple distributions, but they are being used to compute the number average. Something like:

These distributions define the number density of particles. The resulting scattering is the number average over the distribution.

Probably not worth changing.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, several changes to polydispersity.rst:

  • Have added a link to the end of the opening sentence (that resolves to PStheory):
    image

  • Have changed the 'number distribution' sentence to read:
    image

  • In array distribution have changed the existing text after the example array to a Note (the existing text had grammatical & typo errors anyhow) and added a new sentence to the bottom:
    image

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And in fitting_help.rst:

  • Have changed the link from :ref:Interaction_and_Mixture_Models to :ref:Interaction_Models as requested.

  • Have also added a link to :ref:PStheory: from the Polydisperse Parameters sub-section:
    image

  • Have revised the wording of the note regarding number density to echo that now in polydispersity.rst:
    image

  • Added a new note:
    image

  • And have added a section flagging that you can reparameterize models:
    image

Breakage in yaml syntax coming from merge from main is interfering with CI. Try fixing it...
@wpotrzebowski
Copy link
Contributor

ready for testing on OSX

@wpotrzebowski
Copy link
Contributor

Hmm, Jenkins is not happy about this:
/Users/sasview/Jenkins/workspace/SasView-OSX10.13-ghprb/sasview/docs/sphinx-docs/source-temp/user/qtgui/Perspectives/Fitting/fitting_help.rst:709: WARNING: undefined label: reparameterized_models (if the link has no caption the label must precede a section header

@smk78
Copy link
Contributor Author

smk78 commented Nov 5, 2021

@wpotrzebowski That's odd. The link target was added to Sasmodels /doc/guide/plugin.rst in this commit SasView/sasmodels@3965bee which has been merged. Is it possible Jenkins was trying to build against an outdated Sasmodels?

@smk78
Copy link
Contributor Author

smk78 commented Nov 5, 2021

ready for testing on Windows

@smk78
Copy link
Contributor Author

smk78 commented Nov 5, 2021

I've just built this branch locally against the current Sasmodels master and the link resolves fine. I think it's a Jenkins issue.

@wpotrzebowski
Copy link
Contributor

ready for testing on OSX

@wpotrzebowski wpotrzebowski merged commit 726a60d into main Nov 9, 2021
@wpotrzebowski wpotrzebowski deleted the DocUpdatePD branch November 9, 2021 14:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation Concerns documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants