Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

problem with model documentation template #607

Open
butlerpd opened this issue Aug 17, 2024 · 1 comment
Open

problem with model documentation template #607

butlerpd opened this issue Aug 17, 2024 · 1 comment

Comments

@butlerpd
Copy link
Member

butlerpd commented Aug 17, 2024

The model documentation automatically labels scale in the table of parameters as “scale or volume fraction.” This is correct for all shapes. However it makes no sense for shape-independent models where it may have other meaning, most notably I(0), proportional to Mw, for Guinier (IF on absolute scale).

But every model will be different and how to interpret scale should be left to documentation.

SUGGESTIONS:

  • when creating the documentation scrape for model category and edit the entry based on that: If a shape, behave as now, if model independent leave to the author edited documentation to interpret the meaning of scale and do not add "or volume fraction."
  • Alternatively just remove vol fraction and make that something that each model needs to state separately.

NOTE: Identified during use in the NIST CNR summer school

@pkienzle
Copy link
Contributor

pkienzle commented Sep 3, 2024

The proposed change could be done after this line:

info.category = getattr(kernel_module, 'category', None)

using:

if info.category and not info.category.startswith("shape:"):
    info.parameters["scale"].description = "Scale factor"
    # Note: this updates both info.base and info.parameters since they share the same underlying
    # object (up until core.reparameterize() makes a modified copy in info.parameters).

You could instead make a generic string that applies to all models by changing this line:

("scale", "", 1, (0.0, np.inf), "", "Scale factor or Volume fraction"),

Something like "Model scale factor, including effects such as volume fraction"

Giving the model definition file control over scale is more difficult.

We could add yet another magic variable name, such as scale_description = "<model specific scale interpretation>", with code like:

info.scale_description = getattr(kernel_module, 'scale_description', None)
if info.scale_description:
    info.parameters["scale"].description = info.scale_description

More generally, we could add post_import_hook and do something like:

def post_import_hook(info):
    info.parameters["scale"].description = "model specific scale interpretation"

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

2 participants