-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
fix passing of curvefit kwargs #6978
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
base: main
Are you sure you want to change the base?
Conversation
Thanks for doing this @slevang ! Would you mind adding a tiny regression test too? |
Right, I guess this actually breaks the previous way of passing kwargs and that is why the docs build failed. Hmmm. To go with the current changes, thoughts on adding something like this to the parsing logic: if kwargs is None:
kwargs = {}
elif "kwargs" in kwargs:
kwargs = {**kwargs.pop("kwargs"), **kwargs} to allow for the desired functionality but also handle the old case when someone passes BTW it took me a minute to figure out what happened here because the docstring in the original PR was actually correct (requiring a dict, albeit maybe not the best way of passing kwargs), but then got changed in #5182 to suggest that kwargs could be passed on their own. I see |
Is that something that will be deprecated or is it planned to keep the support for the kwargs dict forever? |
Not sure if there are any strong opinions here? I don't see much harm in keeping it around but we could also deprecate. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, @slevang !
Deprecation can be added in a later PR once we figure out what we want.
I think we may want to keep only the current behaviour (perhaps add an example to the docstring instead), and have that be consistent across the project when we wrap external functions. It's similar to what we do with Can someone open an issue to discuss this? |
curvefit
throws an exception. #6891whats-new.rst