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

Bug observed in a corner case of conditional_entropy #818

Open
dachengx opened this issue Apr 9, 2024 · 0 comments
Open

Bug observed in a corner case of conditional_entropy #818

dachengx opened this issue Apr 9, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@dachengx
Copy link
Collaborator

dachengx commented Apr 9, 2024

Describe the bug
Originally from https://github.com/AxFoundation/strax/actions/runs/8616664551/job/23614765492?pr=816.

Because that log of GitHub action will not be kept forever, I copy-paste the information here:

=========================== short test summary info ============================
FAILED tests/test_hitlet.py::test_conditional_entropy - AssertionError: Hitlet entropy is -279097920.0, but expected np.nan
assert False
 +  where False = <ufunc 'isnan'>(-279097920.0)
 +    where <ufunc 'isnan'> = np.isnan
Falsifying example: test_conditional_entropy(
    data=array([-1.0000001,  0.       , -1.       ,  1.0000001,  1.       ,
            0.       ,  0.       ,  0.       ], dtype=float32),
    size_template_and_ind_max_template=[0, 1],  # or any other generated value
)

You can reproduce this example by temporarily adding @reproduce_failure('6.98.15', b'AXicY2dkYGBgbAASDA5ABhMQM0AAIyMzkITLsDDAASMDMmAEAEo/AZo=') as a decorator on your test case
=========== 1 failed, 188 passed, 114 warnings in 558.93s (0:09:18) ============

Though the bug is observed in a PR, the error can be reproduced in master branch with commit hash: a1e921f.

To Reproduce
Decorate test_conditional_entropy by:

@reproduce_failure('6.98.15', b'AXicY2dkYGBgbAASDA5ABhMQM0AAIyMzkITLsDDAASMDMmAEAEo/AZo=')

then run pytest -xv ./tests/ -k test_conditional_entropy at the top level of strax repo.

Error:

============================================== short test summary info ==============================================
FAILED tests/test_hitlet.py::test_conditional_entropy - AssertionError: Hitlet entropy is -279097920.0, but expected np.nan
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! stopping after 1 failures !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
========================================= 1 failed, 188 deselected in 2.18s =========================================

Expected behavior
A clear and concise description of what you expected to happen.

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

Versions
a1e921f

@dachengx dachengx added the bug Something isn't working label Apr 9, 2024
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

No branches or pull requests

2 participants