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

Reparameterizing an inline C model fails #2958

Open
tsole0 opened this issue Jul 15, 2024 · 0 comments
Open

Reparameterizing an inline C model fails #2958

tsole0 opened this issue Jul 15, 2024 · 0 comments
Labels
Defect Bug or undesirable behaviour

Comments

@tsole0
Copy link
Contributor

tsole0 commented Jul 15, 2024

**Partner issue in sasmodels: SasView/sasmodels#605

Describe the bug
Please see sasmodels issue linked above for description of the bug

To Reproduce (in SasView GUI)
Steps to reproduce the behavior:

  1. Open a new .py model in your sasview user plugin directory (normally ...\UserDir\.sasview\plugin_models\)
  2. Copy in the following code:
from numpy import inf

from sasmodels.core import reparameterize
from sasmodels.special import *

parameters = [
    # name, units, default, [min, max], type, description
	['new', '', 0, [-inf, inf], '', ''],
]

translation = """
    sld = new
"""

model_info = reparameterize('lamellar', parameters, translation, __file__)
  1. Save file and select it in a NEW fit widow inside SasView
  2. Load example data into the fit window
  3. View error message in log explorer (... error: 'sld' undeclared)

Expected behavior
The model should have no issues being loaded or used with the new redefinitions.

Screenshots
The reparameterized model:
image

Behavior in SasView:

image

SasView version (please complete the following information):

  • Version: 6.0.0b (developer ver)

Operating system (please complete the following information):

  • OS: Windows 10

Suggested Solution:
Either deprecate using inline C code (only one model currently uses it and it is easily replaceable), or fix the reparameterization code in sasmodels.core to support inline C code.

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

No branches or pull requests

1 participant