Skip to content

[Doc]: describe deprecation process more explicitly #21393

Closed

Description

@story645

Documentation Link

https://matplotlib.org/devdocs/api/_api_api.html?highlight=deprecation#matplotlib._api.deprecation.warn_deprecated

Problem

I'm deeply confused about whether since is the last release that has the arg or the first release without it. It's documented as The release at which this API became deprecated. which I assume is following some convention, but is not clear to me since I do not know the convention.

Suggested improvement

Add a sentence to the since docstring (and possibly to https://matplotlib.org/devdocs/devel/contributing.html#api-changes) saying something like: the last release containing this code. I think https://docs.moodle.org/dev/Deprecation do a good job at illustrating the convention.

Edit: as @QuLogic suggested, don't modify the docstring but explain the deprecation to removal process more explicitly in the API changes part of the dev guide.

Matplotlib Version

dev

Matplotlib documentation version

dev

Activity

  1. QuLogic commented on Oct 20, 2021

    @QuLogic
    Member

    I'm deeply confused about whether since is the last release that has the arg or the first release without it.

    Neither. It is, as documented, when it became deprecated. The release where it's removed is determined by the removal argument (and by whether anyone remembers to remove it), which defaults to "two minor releases later". There are no decorators for removed API, because, well, they've been removed.

  2. story645 commented on Oct 20, 2021

    @story645
    MemberAuthor

    when it became deprecated

    Ok, so then does the since arg mark when the decision was made to deprecate the arg?

  3. jklymak commented on Oct 20, 2021

    @jklymak
    Member

    Its the release where the argument was first deprecated. So if you have a PR with a 3.6 milestone, and you deprecate something you would put since='3.6'

  4. story645 commented on Oct 20, 2021

    @story645
    MemberAuthor

    Its the release where the argument was first deprecated.

    @QuLogic made the same point, but the mpl docs on deprecation don't unpack what the 'deprecation' process is. What I'm gathering from your and Elliot's comments is that the since kwarg marks when the deprecation process was initiated for whichever arg is being deprecated.

  5. jklymak commented on Oct 20, 2021

    @jklymak
    Member

    The process is that you get your instance of warn_deprecated into the codebase!

  6. QuLogic commented on Oct 20, 2021

    @QuLogic
    Member

    If you're asking for more documentation on the deprecation process from deprecation to removal, then yea, I think that could be written. I'm not sure it belongs in warn_deprecated, but a reference to the API change page you had is a good idea.

  7. changed the title [-][Doc]: deprecation decorator 'since' arg[/-] [+][Doc]: describe deprecation process more explicitly[/+] on Oct 20, 2021
  8. story645 commented on Oct 20, 2021

    @story645
    MemberAuthor

    Totally agree, I think better documenting the process in the dev guide & cross linking those docs in warn_deprecate will probably solve this issue as far as I'm concerned.

    (Updated name & description to include this suggestion).

  9. story645 commented on Oct 20, 2021

    @story645
    MemberAuthor

    It's written a little too much assuming that the audience knows what deprecation means in the exact context it's written in, so it took a few rereads for me to get that since (I think?) refers to

    Deprecations are targeted at the next point-release (i.e. 3.x.0).

    I think small changes should do the trick: a sentence defining deprecation, reworking the sentence above so it's clearer that's what the since keyword is referring to, maybe rearrange bullets so that the bullet points that are tied to the warn_deprecate params are clustered together.

    Edit: but as a first pass, cross-linking to those docs would definitely be an improvement.

  10. timhoffm commented on Nov 13, 2021

    @timhoffm
    Member

    all that's written about are Deprecations but there are other API changes apart from Deprecations, right? (e.g. Removals, Behavior Changes, etc.).

    A deprecation is not an API change; it's a note on an upcoming API change. Deprecating an API is mandatory before changing it.

    I think this whole API section is flawed and would need to be rewritten from scatch:

    Messages:

    • API stability is a great value. Changing an API is a pain for the affected users. We only change an API if the benefit is larget than the pain. This is a careful decision.
    • Rules
      • Deprecations are targeted at the next point-release (i.e. 3.x.0).
      • Deprecated API may be removed two point-releases after they were deprecated.
      • If in doubt, decisions on API changes are finally made by the API consistency lead developer.
    • How to deprecate:
      • Doc announcement
      • Runtime warning (if possible)
      • If there is an alternative for the deprecated API, that should already be available during the deprecation period if possible. (I assume that's what the below point was trying to say, but got it mixed up.)

    I think this bullet point from the existing docs is wrong:

    The deprecated API should, to the maximum extent possible, remain fully functional during the deprecation period. In cases where this is not possible, the deprecation must never make a given piece of code do something different than it was before; at least an exception should be raised.

    The old API must remain fully functional during the deprecation period.

    a sentence defining deprecation

    Ok, I agree that clarity is good. OTOH I'm not too worried here on loosing audience. Generally, If you don't know what a deprecation is, you most likely won't have the experience to estimate the consequences of an API change and should leave this to more experienced people.

  11. timhoffm commented on Nov 13, 2021

    @timhoffm
    Member

    Yes, I meant "consistency".

  12. added this to the v3.5.1 milestone on Nov 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions