Skip to content
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

Merged
merged 1 commit into from
Apr 10, 2024

Conversation

tnatt
Copy link
Collaborator

@tnatt tnatt commented Apr 10, 2024

PR to move deprecations present in ExportData init to the _show_deprecations_or_notimplemented function.

Also changed two PendingDeprecationWarnings to UserWarnings

  • Did consider FutureWarning but since the features already are deprecated and the argument has no effect, it felt more natural to give a UserWarning

)

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,
Copy link
Member

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

Copy link
Collaborator Author

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.

Copy link
Member

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

Copy link
Member

@perolavsvendsen perolavsvendsen left a 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 👍

@tnatt tnatt merged commit 34a684b into equinor:main Apr 10, 2024
13 checks passed
@tnatt tnatt deleted the deprecations_cln branch April 10, 2024 09:44
tnatt added a commit to tnatt/fmu-dataio that referenced this pull request Apr 10, 2024
tnatt added a commit to tnatt/fmu-dataio that referenced this pull request Apr 10, 2024
tnatt added a commit to tnatt/fmu-dataio that referenced this pull request Apr 10, 2024
tnatt added a commit to tnatt/fmu-dataio that referenced this pull request Apr 10, 2024
tnatt added a commit to tnatt/fmu-dataio that referenced this pull request Apr 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants