Skip to content

Deprecate ambiguous units #5793

Closed
Closed

Description

@mhvk

E.g. emu #4918, possibly there are others; prefixed solar, earth, and jupiter mass in #5661.

This issue is for discussion about ways to deprecate (prefixed) units. A first possible implementation (#5787), which emitted warnings on importing units was deemed too drastic, since the whole point is that most of those units are rarely if ever used.

A suggestion by @pllim was to move deprecated units to a separate module (say, units.deprecated. This has the advantage that if code still really needs it, one can imagine being able to do with u.decprecated.enable() just like one can do with u.imperial.enable(). It might also be possible to not just remove a unit altogether from the astropy.units namespace, but first replace it with something that will emit a warning when used but otherwise behaves like the unit. (Perhaps easier would be just to raise an exception, telling what to do to solve it).

Activity

  1. added this to the v2.0.0 milestone on Feb 10, 2017
  2. eteq commented on Jun 16, 2017

    @eteq
    Member

    @mhvk - #5661 amd #5906 are in, so I think this can be closed, right?

  3. mhvk commented on Jun 16, 2017

    @mhvk
    ContributorAuthor

    Yes, I think this is done -- we now have a nice system in place!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions