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 1 commit
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
7 changes: 7 additions & 0 deletions scipy/stats/tests/test_distributions.py
Expand Up @@ -37,6 +37,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 @@ -2851,6 +2855,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 +2873,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 All @@ -2879,6 +2885,7 @@ def test_issue_12796(self):
res = stats.beta.cdf(inv, a, b)
assert_allclose(res, 1 - alpha_2)

@pytest.mark.skipif(MACOS_INTEL, reason="Overflow, see gh-14901")
Copy link
Contributor

Choose a reason for hiding this comment

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

I thought the third failing test was test_issue_12635 above, unless I'm misreading the diff

 FAILED scipy/stats/tests/test_distributions.py::TestBeta::test_issue_12635 - ...
FAILED scipy/stats/tests/test_distributions.py::TestBeta::test_issue_12794 - ...
FAILED scipy/stats/tests/test_distributions.py::TestBeta::test_issue_12796 - ...

Copy link
Contributor

Choose a reason for hiding this comment

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

I went ahead and pushed that in--probably just some speedy copy-paste work.

def test_endpoints(self):
# Confirm that boost's beta distribution returns inf at x=1
# when b<1
Expand Down