-
Notifications
You must be signed in to change notification settings - Fork 3
bug: remove deprectaed np.complex_ type #6
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
Closed
Closed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
may I suggest a test and a bit of a clean-up
…>= 2.0.0 + linted using pylint.
Updated to be compatible with numpy>=2.0.0
ns-rse
added a commit
to AFM-SPM/TopoStats
that referenced
this pull request
May 15, 2025
With updates to [topoly-1.1.0]() newer versions of Numpy are supported. However TensorFlow still requires <2.1.0. At the same time I discovered there are problems with some of the data types in [numpyencoder](https://github.com/hmallen/numpyencoder). Last week I reported [Support for np.float_ removed](hmallen/numpyencoder#5) only to find that this had already been addressed in the `master` branch but that the tag applied `v0.30. - NumPy 2.0 Compatibility` whilst building a tar-ball on GitHub hadn't triggered or resulted in a version bump on PyPI. Today I discovered that `np.complex_` is also deprecated in Numpy 2.0 and whilst I have made a [pull request](hmallen/numpyencoder#6) to have that addressed in `numpyencoder`, rather than waiting on that I have forked the repository to the AFM-SPM organisation and fixed it there, setting TopoStats to install from the `master` branch of that fork. If/when a new release of `numpyencoder` is made I will revert to using the PyPI version.
Owner
|
Removing this entirely would break backwards compatibility. I hadn't considered this before the previous change. I'll create a new release with existing changes then look into fully removing deprecated types in a subsequent release. |
This was referenced Jun 3, 2025
Closed
ns-rse
added a commit
to AFM-SPM/TopoStats
that referenced
this pull request
Jun 3, 2025
With updates to [topoly-1.1.0]() newer versions of Numpy are supported. However TensorFlow still requires <2.1.0. At the same time I discovered there are problems with some of the data types in [numpyencoder](https://github.com/hmallen/numpyencoder). Last week I reported [Support for np.float_ removed](hmallen/numpyencoder#5) only to find that this had already been addressed in the `master` branch but that the tag applied `v0.30. - NumPy 2.0 Compatibility` whilst building a tar-ball on GitHub hadn't triggered or resulted in a version bump on PyPI. Today I discovered that `np.complex_` is also deprecated in Numpy 2.0 and whilst I have made a [pull request](hmallen/numpyencoder#6) to have that addressed in `numpyencoder`, rather than waiting on that I have forked the repository to the AFM-SPM organisation and fixed it there, setting TopoStats to install from the `master` branch of that fork. If/when a new release of `numpyencoder` is made I will revert to using the PyPI version.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Further to #5 I've found in using
numpyencoderwithnumpy==2.0.2thatnp.complex_has also been deprecated and it is recommended to usenp.complex128. As this is already one of the items in the tuple I've simply removednp.complex_from the tuple of possible types.Would be useful if this and the
np.float_issue I reported in #5 which has already been addressed could be released to PyPI asv0.3.1🙏