Repository: aelanman/lunarsky

Issue:
`astropy.utils.check_broadcast` is deprecated
The warning message suggests using `np.broadcast_shapes` instead.

Hints from issue comments:

Solution patch:
diff --git a/lunarsky/mcmf.py b/lunarsky/mcmf.py
index 88b85b9..e462f6a 100644
--- a/lunarsky/mcmf.py
+++ b/lunarsky/mcmf.py
@@ -5,7 +5,6 @@
     CartesianDifferential,
     UnitSphericalRepresentation,
 )
-from astropy.utils import check_broadcast
 from astropy.coordinates.baseframe import (
     BaseCoordinateFrame,
     base_doc,
@@ -69,7 +68,7 @@ def make_transform(coo, toframe):
 
     # Make arrays
     ets = np.atleast_1d((obstime - _J2000).sec)
-    shape_out = check_broadcast(coo.shape, ets.shape)
+    shape_out = np.broadcast_shapes(coo.shape, ets.shape)
 
     coo_cart = coo.cartesian
 
diff --git a/lunarsky/topo.py b/lunarsky/topo.py
index bc39ff4..3146481 100644
--- a/lunarsky/topo.py
+++ b/lunarsky/topo.py
@@ -7,7 +7,7 @@
     UnitSphericalRepresentation,
     CartesianRepresentation,
 )
-from astropy.utils import check_broadcast, exceptions
+from astropy.utils import exceptions
 from astropy.coordinates.baseframe import (
     BaseCoordinateFrame,
     base_doc,
@@ -130,7 +130,7 @@ def make_transform(coo, toframe):
     # Make arrays
     ets = (obstime - _J2000).sec
     stat_ids = np.asarray(location.station_ids)
-    shape_out = check_broadcast(coo.shape, ets.shape, location.shape)
+    shape_out = np.broadcast_shapes(coo.shape, ets.shape, location.shape)
 
     # Set up SPICE ephemerides and frame details
     _spice_setup(location, stat_ids)


Test patch:
diff --git a/lunarsky/tests/test_transforms.py b/lunarsky/tests/test_transforms.py
index 9afa83d..68dfa3c 100644
--- a/lunarsky/tests/test_transforms.py
+++ b/lunarsky/tests/test_transforms.py
@@ -3,7 +3,7 @@
 from lunarsky.time import Time, TimeDelta
 import astropy.coordinates as ac
 from astropy import units as un
-from astropy.utils import IncompatibleShapeError, exceptions
+from astropy.utils import exceptions
 from astropy.tests.helper import assert_quantity_allclose
 import lunarsky
 from lunarsky.moon import SELENOIDS
@@ -277,7 +277,9 @@ def test_incompatible_transform(fromframe):
         )
     )
     src = lunarsky.SkyCoord(coo)
-    with pytest.raises(IncompatibleShapeError):
+    with pytest.raises(
+        ValueError, match="shape mismatch: objects cannot be broadcast to a single shape"
+    ):
         src.transform_to(ltop)