Skip to content

Commit

Permalink
TST: Handle flaky scipy in OSX ARM64
Browse files Browse the repository at this point in the history
  • Loading branch information
pllim committed Apr 23, 2024
1 parent e9ba0db commit d5d3ed2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
8 changes: 7 additions & 1 deletion astropy/modeling/tests/test_quantities_fitting.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,13 @@ def test_fitting_with_initial_values(fitter):

# Fit the data using a Gaussian with units
g_init = models.Gaussian1D(amplitude=1.0 * u.mJy, mean=3 * u.cm, stddev=2 * u.mm)
g = fitter(g_init, x, y)
# https://github.com/astropy/astropy/issues/16320 (scipy can be flaky in OSX ARM64)
if sys.platform == "darwin":
ctx = np.errstate(invalid="ignore")
else:
ctx = contextlib.nullcontext()
with ctx:
g = fitter(g_init, x, y)

# TODO: update actual numerical results once implemented, but these should
# be close to the values below.
Expand Down
3 changes: 2 additions & 1 deletion docs/coordinates/matchsep.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ as methods on the coordinate objects.
In the examples below, we will assume that the following imports have already
been executed::

>>> import numpy as np
>>> import astropy.units as u
>>> from astropy.coordinates import SkyCoord

Expand Down Expand Up @@ -250,7 +251,7 @@ the catalog:
.. doctest-requires:: scipy

>>> matches = catalog[idx]
>>> (matches.separation_3d(c) == d3d).all()
>>> np.allclose(matches.separation_3d(c), d3d)
True
>>> dra, ddec = c.spherical_offsets_to(matches)

Expand Down

0 comments on commit d5d3ed2

Please sign in to comment.