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: Fix errors from deprecated API use with NumPy 2.0 API #330

Merged
merged 6 commits into from
Jul 29, 2024

Conversation

carterbox
Copy link
Contributor

@carterbox carterbox commented Jul 25, 2024

Purpose

Avoid deprecation warnings and fix errors from NumPy 2.0 API.

Approach

Ran the tests and fixed errors and deprecation warnings related to type casting from complex to real and from Python types to NumPy types.

Pre-Merge Checklists

Submitter

  • Write a helpfully descriptive pull request title.
  • Organize changes into logically grouped commits with descriptive commit messages.
  • Document all new functions.
  • Click 'details' on the readthedocs check to view the updated docs.
  • Write tests for new functions or explain why they are not needed.
  • Address any complaints from pep8speaks.

Reviewer

  • Actually read all of the code.
  • Run the new code yourself; the included tests should make this easy.
  • Write a summary of the changes as you understand them.
  • Thank the submitter.

@pep8speaks
Copy link

pep8speaks commented Jul 25, 2024

Hello @carterbox! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

Line 506:81: E501 line too long (87 > 80 characters)

Line 333:81: E501 line too long (94 > 80 characters)
Line 385:81: E501 line too long (87 > 80 characters)

Comment last updated at 2024-07-26 20:00:10 UTC

This smoke test for the clustering methods relies on argpartition
returning the same result every time. However, the behavior of
argparition changed with NumPy 2.0. Fortunately(?) the behavior
change is not a bug because argparition never promised a stable
paritioning, it only promises that elements will correctly be
divided before and after the pivot. However, these test must
be removed because they are recall tests which assume that every
argparition implementation returns the exact same result.
@carterbox carterbox merged commit 6bc53b0 into AdvancedPhotonSource:main Jul 29, 2024
6 of 7 checks passed
@carterbox carterbox deleted the deprecations branch July 29, 2024 15:14
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.

2 participants