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: silence test failures on macOS for beta.ppf overflow #14938

Merged
merged 3 commits into from Oct 30, 2021
Merged
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
8 changes: 8 additions & 0 deletions scipy/stats/tests/test_distributions.py
Expand Up @@ -7,6 +7,7 @@
import pickle
import os
import json
import platform

from numpy.testing import (assert_equal, assert_array_equal,
assert_almost_equal, assert_array_almost_equal,
Expand Down Expand Up @@ -37,6 +38,10 @@
# python -OO strips docstrings
DOCSTRINGS_STRIPPED = sys.flags.optimize > 1

# Failing on macOS 11, Intel CPUs. See gh-14901
MACOS_INTEL = (sys.platform == 'darwin') and (platform.machine() == 'x86_64')
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we need to add import platform above--let me see if I can push that in real quick



# distributions to skip while testing the fix for the support method
# introduced in gh-13294. These distributions are skipped as they
# always return a non-nan support for every parametrization.
Expand Down Expand Up @@ -2840,6 +2845,7 @@ def test_fit_duplicated_fixed_parameter(self):
x = [0.1, 0.5, 0.6]
assert_raises(ValueError, stats.beta.fit, x, fa=0.5, fix_a=0.5)

@pytest.mark.skipif(MACOS_INTEL, reason="Overflow, see gh-14901")
def test_issue_12635(self):
# Confirm that Boost's beta distribution resolves gh-12635.
# Check against R:
Expand All @@ -2851,6 +2857,7 @@ def test_issue_12635(self):
p, a, b = 0.9999999999997369, 75.0, 66334470.0
assert_allclose(stats.beta.ppf(p, a, b), 2.343620802982393e-06)

@pytest.mark.skipif(MACOS_INTEL, reason="Overflow, see gh-14901")
def test_issue_12794(self):
# Confirm that Boost's beta distribution resolves gh-12794.
# Check against R.
Expand All @@ -2868,6 +2875,7 @@ def test_issue_12794(self):
res = stats.beta.sf(inv, count_list + 1, 100000 - count_list)
assert_allclose(res, p)

@pytest.mark.skipif(MACOS_INTEL, reason="Overflow, see gh-14901")
def test_issue_12796(self):
# Confirm that Boost's beta distribution succeeds in the case
# of gh-12796
Expand Down