Skip to content

Fixed a bug with frame attributes that are coordinates when checking for frame equivalency#10290

Merged
mhvk merged 1 commit intoastropy:masterfrom
ayshih:is_equivalent_frame
May 4, 2020
Merged

Fixed a bug with frame attributes that are coordinates when checking for frame equivalency#10290
mhvk merged 1 commit intoastropy:masterfrom
ayshih:is_equivalent_frame

Conversation

@ayshih
Copy link
Contributor

@ayshih ayshih commented May 4, 2020

Fixes #10287

  • BaseCoordinateFrame's version of is_equivalent_frame() already had a private function for special handling of representation attributes (which is possibly removable in light of Implement __eq__ and __ne__ for coordinate classes #10154, but I did not touch that), so I added special handling for coordinate attributes. Now, if the coordinate attributes do not have equivalent frames, it avoids checking for equality (which would raise an error).
  • I changed SkyCoord's version of is_equivalent_frame() to call the private function under BaseCoordinateFrame.

@ayshih ayshih force-pushed the is_equivalent_frame branch from 079d854 to 4ed6520 Compare May 4, 2020 03:53
@taldcroft taldcroft added this to the v4.1 milestone May 4, 2020
@taldcroft taldcroft added the Bug label May 4, 2020
@taldcroft taldcroft requested review from eteq and mhvk May 4, 2020 10:23
@taldcroft
Copy link
Member

Milestoned for 4.1 as this fixes a problem in SunPy introduced by #10154.

Copy link
Contributor

@mhvk mhvk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! And good to have tests to ensure that this doesn't break again. Thanks, @ayshih!

@mhvk mhvk added the Affects-dev PRs and issues that do not impact an existing Astropy release label May 4, 2020
@mhvk mhvk merged commit 87799f6 into astropy:master May 4, 2020
@ayshih ayshih deleted the is_equivalent_frame branch May 4, 2020 13:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Affects-dev PRs and issues that do not impact an existing Astropy release Bug coordinates

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Changes to SkyCoord equality incompatible with a SkyCoord frame attribute

3 participants