Skip to content

Reminder: consider removing unused, internal C code #18951

Open

Description

@neutrinoceros

Following #18800, the @deprecated_keywords decorator is currently unused. Since it was always explicitly private, and is implemented in C, I think we should remove it completely before astropy 8.0.0 final, unless, of course, it finds a new use in the mean time.
If it's used again, outside of the cosmology submodule, it should be moved to astropy.utils (but still only be added to a private namespace)

Activity

  1. added this to the v8.0.0 milestone on Nov 16, 2025
  2. pllim commented on Nov 17, 2025

    @pllim
    Member

    Looks like it was you who added it in #16597 . I guess it is okay to remove if unused and private but @nstarman should confirm since it is in cosmology.

  3. nstarman commented on Nov 17, 2025

    @nstarman
    Member

    IMO we should make more variables in astropy positional-only.

  4. pllim commented on Nov 17, 2025

    @pllim
    Member

    Now, now, let's not go crazy. New code API is anyone's game but please leave the existing stable code API alone unless there is a very good reason (besides style and latest trend).

    I would like to keep the discussions here solely about removing this particular C code and nothing else.

    Thank you for your understanding.

  5. nstarman commented on Nov 17, 2025

    @nstarman
    Member

    The very good reason is "Positional-only parameters give more control to library authors to better express the intended usage of an API and allows the API to evolve in a safe, backward-compatible way." PEP.
    We can remove the C code now, but if we're committed to improving API we'll have to bring it back in order to handle deprecations.

  6. neutrinoceros commented on Nov 17, 2025

    @neutrinoceros
    ContributorAuthor

    (FWIW I'm considering spinning it off as a reusable, self contained package)

  7. Iquecs2005 commented on Apr 25, 2026

    @Iquecs2005
    Contributor

    Hi, i would like to contribute to this issue!
    I was already working on it and have a branch with all the modifications needed to remove the @deprecated_keywords decorator before i saw the last comment.
    Have you decided to remove it or make it a new package?

  8. neutrinoceros commented on Apr 26, 2026

    @neutrinoceros
    ContributorAuthor

    Neither, though I note that the decorator is actually still being used in astropy 8.0.0-dev, so we cannot actually remove the definitions yet, and it'll have to wait for 9.0.0, which isn't planned yet.

  9. modified the milestones: v8.0.0, v9.0.0 on Apr 26, 2026
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

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions