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

Fix numpy 1.20 deprecation warnings #468

Merged
merged 1 commit into from Mar 24, 2021

Conversation

rmcgibbo
Copy link
Contributor

This PR tries to fix a set of deprecation warnings thrown when hdbscan runs with numpy 1.20:

DeprecationWarning: `np.int` is a deprecated alias for the builtin `int`. To silence this warning, use `int` by itself. Doing this will not modify any behavior and is safe. When replacing `np.int`, you may wish to use e.g. `np.int64` or `np.int32` to specify the precision. If you wish to review your current use, check the release note link for additional information.

Because of the way the test suite checks the warning stack, these deprecation warnings cause test failures against numpy==1.20

python3.8-hdbscan> E           AssertionError: assert False
python3.8-hdbscan> E            +  where False = issubclass(<class 'DeprecationWarning'>, UserWarning)
python3.8-hdbscan> E            +    where <class 'DeprecationWarning'> = <warnings.WarningMessage object at 0x7fffaa4ce880>.category
python3.8-hdbscan> test_flat.py:220: AssertionError

@pep8speaks
Copy link

Hello @rmcgibbo, Thank you for submitting the Pull Request !

Line 148:17: E126 continuation line over-indented for hanging indent
Line 153:63: W504 line break after binary operator
Line 175:25: E126 continuation line over-indented for hanging indent
Line 284:35: W504 line break after binary operator
Line 285:70: W504 line break after binary operator
Line 294:21: E126 continuation line over-indented for hanging indent
Line 339:47: E126 continuation line over-indented for hanging indent
Line 418:30: W504 line break after binary operator
Line 419:47: W504 line break after binary operator
Line 455:39: E226 missing whitespace around arithmetic operator
Line 471:21: E126 continuation line over-indented for hanging indent
Line 661:13: E126 continuation line over-indented for hanging indent
Line 661:76: W504 line break after binary operator
Line 667:28: E226 missing whitespace around arithmetic operator
Line 709:17: E226 missing whitespace around arithmetic operator
Line 709:36: E226 missing whitespace around arithmetic operator
Line 774:21: E126 continuation line over-indented for hanging indent
Line 796:17: W503 line break before binary operator
Line 886:16: E226 missing whitespace around arithmetic operator
Line 890:25: E126 continuation line over-indented for hanging indent
Line 917:19: E226 missing whitespace around arithmetic operator
Line 930:13: E126 continuation line over-indented for hanging indent
Line 931:13: E123 closing bracket does not match indentation of opening bracket's line

Line 139:21: W503 line break before binary operator
Line 247:22: W503 line break before binary operator
Line 308:44: W503 line break before binary operator
Line 310:56: W503 line break before binary operator

@lmcinnes
Copy link
Collaborator

Thanks!

@lmcinnes lmcinnes merged commit 5b67a4f into scikit-learn-contrib:master Mar 24, 2021
@rmcgibbo rmcgibbo deleted the numpy-deprecations branch March 24, 2021 15:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants