You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
check for valid misspelled keywords in models #2163
Do we have a mechanism to warn the user that an argument passed to a model was not used?
A misspelled (nonexistent) argument simply disappears into *kwargs.
It is not easy to do automatically because we use **kwargs for cases when different classes handle parts of the keywords, eg. optional or required arrays in sub classes and missing and similar data handling in base classes. Additionally, we have the generic from_formula which has a different signature and keywords than __init__.
I guess the easiest will be to attach valid_kwds to a class, so we can check generically. We already added init_keys to be able to recreate a model which can be reused.
related: some other functions/methods also don't have a check for misspelled keywords. e.g cov_kwds in fit, plotting options ?
Activity
josef-pkt commentedon Apr 18, 2017
example for fit: I didn't remember which
tolkeyword'bfgs'uses,fitjust ignores incorrect keywordsrelated: #3605 opposite case, explicit white list may be incorrect with new extensions
josef-pkt commentedon Apr 18, 2017
this would be another argument for
optim_kwdswhich are all handed off to the optimizer which should raise if unknown keywords have been added.jbrockmendel commentedon Sep 2, 2018
+1. This is my main objection to the pattern of having **kwargs all over.