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

Szudzik and Cantor Pairing Function Warnings with np.nan #76

Closed
fernando-aristizabal opened this issue Mar 31, 2023 · 1 comment
Closed
Assignees
Labels
bug Something isn't working

Comments

@fernando-aristizabal
Copy link
Member

fernando-aristizabal commented Mar 31, 2023

Current behavior

  • Szudzik and cantor pairing functions are raising RuntimeWarnings for np.nan.

Expected behavior

  • Should not raise.

Steps to replicate behavior (include URLs)

>>> from gval.comparison import pairing_functions
>>> import numpy as np
>>> pairing_functions.szudzik_pair_signed(1,np.nan)
<stdin>:1: RuntimeWarning: invalid value encountered in szudzik_pair_signed
nan
@fernando-aristizabal fernando-aristizabal added the bug Something isn't working label Mar 31, 2023
@fernando-aristizabal fernando-aristizabal self-assigned this Apr 4, 2023
fernando-aristizabal added a commit that referenced this issue Apr 6, 2023
- found no warnings with differing dtypes for 32 and 64bit cases in pairing funcs. #45.
- `_is_not_natural_number` now returns True, False, or raises warning. #56
- created `PairingDict` class to address np.nan issue within dict keys. #76, #79
- changed `_assert_pairing_dict_equal` to test for hashing for #76 and #79.
@fernando-aristizabal
Copy link
Member Author

Closed with PR #82

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

1 participant