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

Deprecation: Fix ptp --> np.ptp for numpy 2.0.0 #228

Merged
merged 4 commits into from
Oct 11, 2024

Conversation

CSSFrancis
Copy link
Member

@CSSFrancis CSSFrancis commented Oct 9, 2024

Description of the change

Support numpy 2.0.0

Progress of the PR

  • Pass tests with numpy 2.0.0

For reviewers

  • The PR title is short, concise, and will make sense 1 year later.
  • New functions are imported in corresponding __init__.py.
  • New features, API changes, and deprecations are mentioned in the
    unreleased section in CHANGELOG.rst.
  • Contributor(s) are listed correctly in credits in diffsims/release_info.py and
    in .zenodo.json.

@CSSFrancis CSSFrancis requested a review from hakonanes October 9, 2024 14:51
@CSSFrancis
Copy link
Member Author

CSSFrancis commented Oct 9, 2024

@hakonanes If you want to review/merge this I can start the process of making a numpy 2.0.0 patch release.

@CSSFrancis CSSFrancis mentioned this pull request Oct 9, 2024
@CSSFrancis CSSFrancis requested a review from pc494 October 9, 2024 16:28
@@ -5,6 +5,11 @@

from diffsims.utils._deprecated import deprecated, deprecated_argument

if np.__version__ >= "2.0.0":
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of repeating this three places, I suggest to add a private diffsims.constants module like we've done in orix: https://github.com/pyxem/orix/blob/develop/orix/constants.py. We can then import this warning from diffsims.constants import VisibleDeprecationWarning.

Copy link
Member

@hakonanes hakonanes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two minor suggestions. Not required for merging.

@hakonanes hakonanes added this to the v0.6.1 milestone Oct 9, 2024
@hakonanes hakonanes added the dev label Oct 9, 2024
@CSSFrancis CSSFrancis merged commit 6f19665 into pyxem:main Oct 11, 2024
12 checks passed
@CSSFrancis CSSFrancis deleted the numpy2 branch October 11, 2024 16:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants