-
Notifications
You must be signed in to change notification settings - Fork 15
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
CLN: Collect deprecations in same function #589
Conversation
) | ||
|
||
if self.grid_model: | ||
warn( | ||
"The 'grid_model' key has currently no function. It will be evaluated " | ||
"for removal in fmu-dataio version 2.", | ||
PendingDeprecationWarning, | ||
UserWarning, |
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.
Do we know that UserWarning
is visible to the user...? Ref discussions
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.
After chatting with chatGPT 😄 I believe it will
Yes, if you have a warnings.warn("message", UserWarning) call in the init method of your class, and a user imports your class into their Python script and creates an instance of the class, they will see the warning when they run the script, unless they have specifically configured the warnings system to suppress it.
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.
OK :) We can also confirm once this is deployed to RMS, I guess
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.
One question in a comment, but generally looks good to me 👍
PR to move deprecations present in ExportData init to the
_show_deprecations_or_notimplemented
function.Also changed two
PendingDeprecationWarnings
toUserWarnings
FutureWarning
but since the features already are deprecated and the argument has no effect, it felt more natural to give aUserWarning