Skip to content

Conversation

@Saransh-cpp
Copy link
Member

Increase the tolerance for the test to pass always.

Closes: #363

@Saransh-cpp Saransh-cpp added the bug Something isn't working label Oct 15, 2024
@Saransh-cpp Saransh-cpp self-assigned this Oct 15, 2024
Copy link
Member

@paddyroddy paddyroddy left a comment

Choose a reason for hiding this comment

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

👌

@Saransh-cpp Saransh-cpp merged commit ff3c975 into main Oct 15, 2024
@Saransh-cpp Saransh-cpp deleted the saransh/flaky_test_ellipticity_gaussian branch October 15, 2024 13:43
Copy link
Collaborator

@ntessore ntessore left a comment

Choose a reason for hiding this comment

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

I disagree with this fix. For a non-truncated Gaussian, the chance of this test failing is something like 3.3e-8 -- if we are seeing noticeably more failures than that, I should investigate whether the function isn't actually broken. But for a sample size $n = 1,000,000$, we should be able to narrow the expected value down to closer than $O(1)/\sqrt{n}$.

Comment on lines 96 to +97
np.testing.assert_allclose(np.std(eps.real), 0.256, atol=1e-3, rtol=0)
np.testing.assert_allclose(np.std(eps.imag), 0.256, atol=1e-3, rtol=0)
np.testing.assert_allclose(np.std(eps.imag), 0.256, atol=1e-2, rtol=0)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why is this only changing the imaginary component?

@Saransh-cpp
Copy link
Member Author

Oops, should have waited for a review. If the chance of it failing is that low (maybe that's why we noticed it 1.5 months into the project), I will just revert and use pytest-rerunfailures.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test_ellipticity_gaussian is flaky

4 participants