-
Notifications
You must be signed in to change notification settings - Fork 269
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
The prefix
string is not added to parameter names for CompositeModel
s
#954
Comments
prefix
string is not added parameter names for CompositeModel
sprefix
string is not added to parameter names for CompositeModel
s
@jcjaskula-aws I'm not sure I agree with your "should" here. I am not even certain that "prefix" makes sense with a Composite Model. You clearly said that the Gaussian Model should have a prefix of 'G_'. The things that look to me like they need fixing are: a) that 'prefix_' got used as a prefix for the derived parameters, and b) how did 'prefix_G_sigma' get defined. Disallowing 'prefix' with (And, yes, no apologies for the delay in responding to this, since you chose to call it an Issue instead of a Discussion). |
My initial experience with this behavior was something like:
and I noticed that I think it would improve the composability if prefix follows how On the other side, I looked for a quick fix and I realized that it won't be straightforward so disallowing
|
@jcjaskula-aws To be clear, the expected usage would be not
but
which seems a lot simpler to me, but doesn't allow for an additional prefix. FWIW, I do not think allowing a prefix for Expecting the user to explicitly set all prefixes makes more sense to me than messing around with chaining prefixes. |
Description
Strings passed via
prefix
when constructing aCompositeModel
should be propagated to each parameter. Currently, it is missing for direct parameters (e.g.amplitude
below) but properly used with derived parameters (likesigma
).A Minimal, Complete, and Verifiable example
returns
mm.prefix
returns the stringprefix_
.I would expect
prefix_G_amplitude
,prefix_G_center
,prefix_G_sigma
,prefix_C_c
and the derived parameters to have expressions using the just-mentioned parameters.Version information
Python: 3.10.14 (main, Mar 19 2024, 21:46:16) [Clang 15.0.0 (clang-1500.3.9.4)]
lmfit: 1.3.1.post0+g3cfd09a1.d20240424, scipy: 1.11.4, numpy: 1.26.3,asteval: 0.9.32, uncertainties: 3.1.6
The text was updated successfully, but these errors were encountered: