From dfa508bd6a6ad9441fd247ef7d13b3284be9be57 Mon Sep 17 00:00:00 2001 From: Callan Gray Date: Wed, 1 Apr 2026 20:34:28 +0800 Subject: [PATCH 1/3] astropy 7.2.0 support Signed-off-by: Callan Gray --- astropy_xarray/coordinates/frame.py | 13 +++++++++++-- docs/requirements.txt | 2 +- pyproject.toml | 8 +++++--- 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/astropy_xarray/coordinates/frame.py b/astropy_xarray/coordinates/frame.py index 210d6735..94ba4c63 100644 --- a/astropy_xarray/coordinates/frame.py +++ b/astropy_xarray/coordinates/frame.py @@ -296,11 +296,20 @@ def load_representation( else: # using frame component names frame_type: BaseCoordinateFrame = frame_transform_graph.lookup_name(frame_name) + + if False: # astropy 7.1+ + representation_info = frame_type._frame_class_cache["representation_info"] + elif False: # astropy 6.0-7.0 + representation_info = frame_type._get_representation_info() + else: + # unknown instantiation avoidance (this should really be a class method) + representation_info = frame_type().representation_info + diff_to_data = ( dict( zip( tuple(DifferentialClass.attr_classes), - frame_type._get_representation_info()[DifferentialClass]["names"], + representation_info[DifferentialClass]["names"], ) ) if DifferentialClass is not None @@ -310,7 +319,7 @@ def load_representation( dict( zip( tuple(RepresentationClass.attr_classes), - frame_type._get_representation_info()[RepresentationClass]["names"], + representation_info[RepresentationClass]["names"], ) ) if RepresentationClass is not None diff --git a/docs/requirements.txt b/docs/requirements.txt index 2d6e110d..602f7256 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,4 +1,4 @@ -astropy==7.1.0 +astropy==7.2.0 xarray>=2022.06.0 pooch netCDF4 diff --git a/pyproject.toml b/pyproject.toml index 281dc117..57e0708f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -27,14 +27,16 @@ requires-python = ">=3.10" dependencies = [ "numpy>=1.23,<2.3.0", "xarray>=2022.06.0,<=2025.4.0", - "astropy>=6.1.0,<7.2.0", + "astropy>=6.1.0", "pandas>=2.3.0,<3.0.0", ] dynamic = ["version"] [project.urls] -Home = "https://github.com/calgray/astropy-xarray" -Documentation = "https://astropy-xarray.readthedocs.io/en/stable" +homepage = "https://github.com/calgray/astropy-xarray" +documentation = "https://astropy-xarray.readthedocs.io/en/stable" +repository = "https://github.com/calgray/astropy-xarray" +issues = "https://github.com/calgray/astropy-xarray/issues" [project.optional-dependencies] test = [ From 7a83a083a2ce6f7a920cce978d4b99d1a239e1b2 Mon Sep 17 00:00:00 2001 From: Callan Gray Date: Thu, 2 Apr 2026 09:08:19 +0800 Subject: [PATCH 2/3] use safe representation_info Signed-off-by: Callan Gray --- astropy_xarray/coordinates/frame.py | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/astropy_xarray/coordinates/frame.py b/astropy_xarray/coordinates/frame.py index 94ba4c63..b1e438f2 100644 --- a/astropy_xarray/coordinates/frame.py +++ b/astropy_xarray/coordinates/frame.py @@ -296,14 +296,7 @@ def load_representation( else: # using frame component names frame_type: BaseCoordinateFrame = frame_transform_graph.lookup_name(frame_name) - - if False: # astropy 7.1+ - representation_info = frame_type._frame_class_cache["representation_info"] - elif False: # astropy 6.0-7.0 - representation_info = frame_type._get_representation_info() - else: - # unknown instantiation avoidance (this should really be a class method) - representation_info = frame_type().representation_info + representation_info = frame_type().representation_info diff_to_data = ( dict( From 3041a4adf612aec17a0ad9862b21c7a3a37a9bf3 Mon Sep 17 00:00:00 2001 From: Callan Gray Date: Sat, 18 Apr 2026 20:39:26 +0800 Subject: [PATCH 3/3] update changelog Signed-off-by: Callan Gray --- docs/whats-new.rst | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/docs/whats-new.rst b/docs/whats-new.rst index bf7b3da8..2b183463 100644 --- a/docs/whats-new.rst +++ b/docs/whats-new.rst @@ -3,6 +3,13 @@ What's new ========== +0.2.1 (TBD) +----------- + +- Added support for `astropy==7.2.0` sky coordinates. + +By `Callan Gray `_. + 0.2.0 (31 Mar 2026) ------------------- @@ -19,7 +26,7 @@ What's new - Added :py:meth:`Dataset.astropy.to_skycoord` accessor. - By `Callan Gray `_. +By `Callan Gray `_. 0.1.0 (17 Jul 2025) ------------------- @@ -36,4 +43,4 @@ What's new * ``Unit()`` is not an instance of :py:class:`astropy.units.Unit`, only :py:class:`astropy.units.UnitBase`. * Different format literals, see `built-in formats `_. - By `Callan Gray `_. +By `Callan Gray `_.