Skip to content

Consider adding __setitem__ to SkyCoord to allow mutability #6394

@taldcroft

Description

@taldcroft

From discussions in #6348, the question here is about the opportunities and implications of allowing SkyCoord to be mutable by adding a __setitem__ method. An implementation of __setitem__ for Time can be seen in #6028, and this addresses some of the complications that arise in setting items in an object with non-trivial attributes (e.g. scale for Time or frame). This issue is not mostly about implementation, we can assume that a suitable implementation can be found.

Opportunities include:

  • Support table vstack and join
  • Support table insert and add rows
  • Making SkyCoord be more like normal arrays. In general mutable arrays are obviously rather useful!
  • Allowing resize
  • Others?

Implications:

  • Astropy code needs to be scrubbed to be sure that __setitem__ clears all caches.
  • Code that really depends on a SkyCoord being immutable? Where can this introduce bugs in code?

Discuss!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions