-
Notifications
You must be signed in to change notification settings - Fork 274
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
Fix #840 #841
Fix #840 #841
Conversation
@JeppeKlitgaard What if |
@newville I believe I came around this by using |
@JeppeKlitgaard I think it could be ok to expect that I think you are right that using
|
@JeppeKlitgaard It would also be good to apply the same approach to the ComplexConstantModel. |
Sorry for not getting back to you! My personal preference would definitely be to only have a single return type that is always reliably arraylike with the same shape as the independent variable – I am fairly sure there are bits of x = [1,2,3]
y = [1,2,3]
model = ConstantModel()
params = model.make_params()
fit = model.fit(y, params, x=x)
fit.plot()
# Raises `TypeError` without this fix This suggests to me that: return c * np.ones(np.shape(x)) is preferable over: try:
c = c * np.ones(np.shape(x))
except TypeError:
pass
return c |
794efbc
to
5820075
Compare
@newville |
@JeppeKlitgaard OK, I will merge this and then fix it myself. But in case |
Description
Fixes: #840
Type of Changes
Skipped most steps out of laziness since this is a tiny fix