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

List of deprecations #1593

Open
schlunma opened this issue May 19, 2022 · 6 comments
Open

List of deprecations #1593

schlunma opened this issue May 19, 2022 · 6 comments
Labels
documentation Improvements or additions to documentation

Comments

@schlunma
Copy link
Contributor

We currently do not have a list where we list all of our deprecations. In order to keep track of the version the deprecated features are scheduled for removal, it would be great to have such a list.

What would be a good place for this? Our documentation? Something on GitHub? @ESMValGroup/esmvaltool-coreteam

@schlunma schlunma added the documentation Improvements or additions to documentation label May 19, 2022
@schlunma schlunma added this to the v2.6.0 milestone May 19, 2022
@valeriupredoi
Copy link
Contributor

valeriupredoi commented May 19, 2022

I reckon in the documentation it would fit very well, look at the Pytest deprecations and removals page

@zklaus
Copy link

zklaus commented May 19, 2022

It would indeed be good to have an overview. However, manual collection of the deprecations doesn't sound appealing because it is some overhead, creates duplication, and is likely to lead to inconsistencies at some point.
Can we collect that information automatically? Perhaps finding the DeprecationWarnings?

@schlunma
Copy link
Contributor Author

An automatic collection sounds like a great idea!

Maybe we could unify our documentation of deprecated features in this context? For example, using the sphinx directive .. deprecated:: 2.5.0 or decorator @deprecated(reason=..., version=...)? This would make it very easy to automatically retrieve the deprecations and the corresponding versions.

@valeriupredoi
Copy link
Contributor

excellent idea @schlunma - my next favourite thing to coding is no coding at all 😆

@schlunma schlunma modified the milestones: v2.6.0, v2.7.0 May 30, 2022
@sloosvel sloosvel modified the milestones: v2.7.0, v2.8.0 Aug 30, 2022
@sloosvel
Copy link
Contributor

After today's release planning meeting, I created the v2.8.0 milestone to assign this issue so that it does not get forgotten.

But the idea is that, in case there are any deprecated features occurring in v2.7.0, they should already be listed following the approach that @schlunma proposed.

@schlunma
Copy link
Contributor Author

schlunma commented Sep 1, 2022

Example for deprecated feature:

def var_name_constraint(var_name):
""":class:`iris.Constraint` using ``var_name``.
Warning
-------
.. deprecated:: 2.6.0
This function has been deprecated in ESMValCore version 2.6.0 and is
scheduled for removal in version 2.8.0. Please use the function
:class:`iris.NameConstraint` with the argument ``var_name`` instead:
this is an exact replacement.
Parameters
----------
var_name: str
``var_name`` used for the constraint.
Returns
-------
iris.Constraint
Constraint.
"""
deprecation_msg = (
"The function ``var_name_constraint`` has been deprecated in "
"ESMValCore version 2.6.0 and is scheduled for removal in version "
"2.8.0. Please use the function ``iris.NameConstraint`` with the "
"argument ``var_name`` instead: this is an exact replacement."
)
warnings.warn(deprecation_msg, ESMValCoreDeprecationWarning)
return NameConstraint(var_name=var_name)

@schlunma schlunma modified the milestones: v2.8.0, v2.9.0 Jan 12, 2023
@schlunma schlunma removed this from the v2.9.0 milestone May 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

4 participants