Repository navigation
Correction to frame standardization - #704
Conversation
Change to return an instance, not a frame, and to check if the frame is already an instance of BaseCoordinateFrame.
larrybradley
left a comment
There was a problem hiding this comment.
Thanks, @sedonaprice. The fix looks good. However, this PR needs a regression test for the bug being fixed.
(I also pushed a small fix to your branch).
Co-authored-by: Larry Bradley <larry.bradley@gmail.com>
Move from function test_compound_spherical_sky to class TestCompoundSphericalSky, to make addition of regression tests more clear.
- Test of compound range region successful creation and has frame expected. - Add test of all region types to confirm behavior for range and other spherical shapes (so long as the frame is defined; eg, not for WholeSphericalSkyRegion). - Ad hoc correction to access `reg1.frame`, not `reg1._frame` in range test, preferring public attribute
|
@larrybradley Regression tests added (after a compound spherical sky test refactor as an independent commit, enabling more clear demarcation of the regression test). The regression test I added for confirming the frame is standardized as expected for all shapes needed a carveout for WholeSphericalSkyRegion. Another option would be to do a minor refactor to introduce a "frame" for a WholeSphericalSkyRegion class. This would have a couple of benefits: (a) consistent behavior with the other region "shapes" (for tests), (b) opportunity for sanity checks (can the whole sky be transformed to X frame?). Something to consider for a different PR. |
larrybradley
left a comment
There was a problem hiding this comment.
LGTM! Thanks, @sedonaprice.
Fixes #703.
Changes the method
SphericalSkyRegion._standardize_frame(), to return an instance, not a frame, and to first check if the frame is already an instance of BaseCoordinateFrame.Test case for that issue now works as expected:
returns