Skip to content

SkyCoord Conversions#13

Merged
calgray merged 10 commits into
mainfrom
skycoordinates
Mar 27, 2026
Merged

SkyCoord Conversions#13
calgray merged 10 commits into
mainfrom
skycoordinates

Conversation

@calgray

@calgray calgray commented Nov 18, 2025

Copy link
Copy Markdown
Owner

Added explicit dataset conversion functions for working with astropy SkyCoord objects.

  • skycoord_to_dataset(skycoord, coords)
  • dataset_to_skycoord(ds)

SkyCoord objects are still not Dataset-like and can't be used and automatically serialised within DataTree, but conversion is now reliable to handle any SkyCoord value.

Additional useful serialisation functions have also been added and organised into submodules in the coordinates package, but these may change in future.

  • Closes SkyCoord to Dataset conversions #8
  • Tests added
  • Passes pre-commit run --all-files
  • User visible changes (including notable bug fixes) are documented in whats-new.rst
  • New functions/methods are listed in api.rst

… Longitude

Signed-off-by: Callan Gray <cal.j.gray@gmail.com>
Signed-off-by: Callan Gray <cal.j.gray@gmail.com>
Signed-off-by: Callan Gray <cal.j.gray@gmail.com>
@codecov-commenter

codecov-commenter commented Feb 17, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 92.63352% with 40 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.67%. Comparing base (ec7aacd) to head (6648a9a).

Files with missing lines Patch % Lines
astropy_xarray/coordinates/frame.py 88.07% 7 Missing and 6 partials ⚠️
...ropy_xarray/tests/test_visibility_serialization.py 84.12% 8 Missing and 2 partials ⚠️
astropy_xarray/time_compat.py 73.33% 7 Missing and 1 partial ⚠️
astropy_xarray/conversion.py 91.42% 1 Missing and 2 partials ⚠️
astropy_xarray/coordinates/representation.py 89.47% 2 Missing ⚠️
astropy_xarray/formatting.py 0.00% 1 Missing and 1 partial ⚠️
astropy_xarray/accessors.py 96.00% 1 Missing ⚠️
astropy_xarray/coordinates/sky_coord.py 97.61% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #13      +/-   ##
==========================================
- Coverage   93.16%   90.67%   -2.50%     
==========================================
  Files          14       27      +13     
  Lines        1653     2187     +534     
  Branches      158      225      +67     
==========================================
+ Hits         1540     1983     +443     
- Misses         74      152      +78     
- Partials       39       52      +13     
Flag Coverage Δ
unittests 90.67% <92.63%> (-2.50%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
astropy_xarray/__init__.py 81.81% <100.00%> (+1.81%) ⬆️
astropy_xarray/coordinates/__init__.py 100.00% <100.00%> (ø)
astropy_xarray/coordinates/core.py 100.00% <100.00%> (ø)
astropy_xarray/tests/test_accessors_coords.py 100.00% <100.00%> (ø)
astropy_xarray/tests/test_accessors_log.py 100.00% <100.00%> (ø)
astropy_xarray/tests/test_accessors_time.py 100.00% <100.00%> (ø)
astropy_xarray/tests/test_frame_conversion.py 100.00% <100.00%> (ø)
astropy_xarray/tests/test_sky_coord.py 100.00% <100.00%> (ø)
astropy_xarray/tests/test_time.py 100.00% <100.00%> (ø)
astropy_xarray/accessors.py 85.67% <96.00%> (-8.62%) ⬇️
... and 7 more

... and 2 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Signed-off-by: Callan Gray <cal.j.gray@gmail.com>
Signed-off-by: Callan Gray <cal.j.gray@gmail.com>
Signed-off-by: Callan Gray <cal.j.gray@gmail.com>
Signed-off-by: Callan Gray <cal.j.gray@gmail.com>
calgray added 3 commits March 27, 2026 16:46
Signed-off-by: Callan Gray <cal.j.gray@gmail.com>
Signed-off-by: Callan Gray <cal.j.gray@gmail.com>
Signed-off-by: Callan Gray <cal.j.gray@gmail.com>
@calgray calgray changed the title Skycoordinates Skycoordinate Conversions Mar 27, 2026
@calgray calgray changed the title Skycoordinate Conversions SkyCoord Conversions Mar 27, 2026
@calgray
calgray marked this pull request as ready for review March 27, 2026 09:32
@calgray
calgray merged commit 82499eb into main Mar 27, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants