-
Notifications
You must be signed in to change notification settings - Fork 39
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
refactor: more detailed deprecated argument warning message #2808
Conversation
I think what we have here is a combination of a warning and an information. We shall warn user that a deprecated arg-name is entered and what is to use instead. I think the message We shall also inform the user about how the value is converted for the current input, otherwise user may think that the entered value has been discarded and try to re-execute the function again. So, perhaps we can structure the code in this way:
|
@mkundu1 do you mean just using a warning print and a separate information print (I imagine you mean something like Regardless, this PR already addresses all 3 points in my understanding, for point 1 we show a warning for the deprecated argument: Let me know if you want to meet offline to discuss this further Edit: addressed by 52e6a8e |
Co-authored-by: Kathy Pippert <84872299+PipKat@users.noreply.github.com>
Co-authored-by: Kathy Pippert <84872299+PipKat@users.noreply.github.com>
6835c63
to
8f3d872
Compare
I believe users will appreciate a more helpful deprecation message for arguments that we mark as deprecated.
The same logic should be applicable for any arguments that we deprecate and are replaced by newer arguments. If time allows, please help identify any gaps/issues.
Also updated the warning stack level so that it refers to the call that results in the deprecation warning, rather than the source of the deprecation warning in the code (see #2808 (comment) below)
Examples for
launch_fluent
which is the only method usingdeprecate_argument
at the momentBefore the changes in this PR:
launch_fluent(show_gui=...)
specificationPyFluentDeprecationWarning: 'show_gui' is deprecated. Use 'ui_mode' instead.
After the changes in this PR:
launch_fluent(show_gui=True)
:launch_fluent(show_gui=False)
:launch_fluent(show_gui=None)
:launch_fluent(show_gui=True, ui_mode="gui")
:show_gui
is ignored and onlyui_mode
applies (no change of behavior in this PR):For previous discussion see #2800 (comment)