Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TST: Handle flaky scipy 1.13 in OSX ARM64 #16329

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 9 additions & 1 deletion astropy/modeling/tests/test_quantities_fitting.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
"""
Tests that relate to fitting models with quantity parameters
"""
import contextlib
import sys

import numpy as np
import pytest
Expand Down Expand Up @@ -111,7 +113,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)
Comment on lines +116 to +122
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like to avoid going with this patch if we can. The behavior isn't flaky, per say: it's deterministic. I'm working on reducing the reproducer outside of astropy so scipy folks can inspect what's going on more easily.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess we can go with #16330 instead but I'd rather not have our CI red until scipy has time to fix it. Thanks for the quick feedback!


# 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()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this one is correct, I think

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would wait to see what scipy end up doing if we going to pin in #16330 , just in case if their fix also get rid of the need to update this.

>>> np.allclose(matches.separation_3d(c), d3d)
True
>>> dra, ddec = c.spherical_offsets_to(matches)

Expand Down