XENONnT / straxen

Streaming analysis for XENON
BSD 3-Clause "New" or "Revised" License
20 stars 32 forks source link

Corner case of `test_inverse_pdf` failure #1354

Closed dachengx closed 6 months ago

dachengx commented 6 months ago

Describe the bug A clear and concise description of what the bug is.

In the ordinary pytest of https://github.com/XENONnT/straxen/pull/1353, an error of test_inverse_pdf is observed: https://github.com/XENONnT/straxen/actions/runs/8576757387/job/23508277771?pr=1353.

To Reproduce Insert the MWE of how to reproduce the error

  1. add @reproduce_failure('6.98.15', b'AXicY2CAAUYgPqABYrGugwsyMAEAGbMBnw==') as the decorator of test_inverse_pdf.
  2. run pytest -xv ./tests -k test_inverse_pdf in straxen folder

like:

@settings(deadline=None)
@given(strategies.floats(0.0, 1.0), strategies.floats(0.01, 0.99), strategies.floats(2.0, 1000))
@reproduce_failure('6.98.15', b'AXicY2CAAUYgPqABYrGugwsyMAEAGbMBnw==')
def test_inverse_pdf(aftobs, aft, s1tot):
    s1top = aftobs * s1tot
    ...

error observed:

FAILED tests/test_patternfit.py::test_inverse_pdf - AssertionError:

In that corner case: aftobs is 1.0, aft is 0.18243408203125003, s1tot is 2.0.

Expected behavior No errors.

Screenshots If applicable, add screenshots to help explain your problem.

Versions Please add the output of:

straxen.print_versions()