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

nptyping latest version still includes deprecated numpy value #153

Closed
GFleishman opened this issue Oct 7, 2024 · 5 comments
Closed

nptyping latest version still includes deprecated numpy value #153

GFleishman opened this issue Oct 7, 2024 · 5 comments

Comments

@GFleishman
Copy link
Contributor

np.bool8 was deprecated in numpy version 1.24.0
numpy/numpy#23755

nptyping still includes this value:
ramonhagenaars/nptyping#124

Due to pynrrd dependency on nptyping, import of pynrrd latest fails.
Keep an eye on nptyping for a fix or remove dependency as @eleftherioszisis suggests.

@GFleishman
Copy link
Contributor Author

Seems like there are lots of deprecated types remaining in nptyping and my issue is probably a duplicate of @eleftherioszisis issue. Leaving open because this issue breaks install/import of pynrrd latest and want to bring attention to the issue.

addisonElliott pushed a commit that referenced this issue Oct 11, 2024
Fixes #152, #153

I replaced `nptyping` NDArray occurrences with `numpy.typing` ones.

I am not sure if it's possible to specify shape restrictions without forcing the package to require `python>=3.9` so that [type subscription](https://peps.python.org/pep-0585/) is available and things like `np.ndarray[Literal[1], np.dtype[Any]]` can be declared.

Note that `numpy.typing.NDArray` is a type alias for `np.ndarray[Any, np.dtype[+ScalarType]]` where `ScalarType` contains the following types:
```
(int,
 float,
 complex,
 bool,
 bytes,
 str,
 memoryview,
 numpy.bool_,
 numpy.complex64,
 numpy.complex128,
 numpy.complex256,
 numpy.float16,
 numpy.float32,
 numpy.float64,
 numpy.float128,
 numpy.int8,
 numpy.int16,
 numpy.int32,
 numpy.int64,
 numpy.longlong,
 numpy.timedelta64,
 numpy.datetime64,
 numpy.object_,
 numpy.bytes_,
 numpy.str_,
 numpy.uint8,
 numpy.uint16,
 numpy.uint32,
 numpy.uint64,
 numpy.ulonglong,
 numpy.void)
```
Although it is simpler to use it as it is, please let me know if a more permissible `NDArray[Any]` is preferred.
@addisonElliott
Copy link
Collaborator

Fixed in #154.

New major release pending

@mgeplf
Copy link

mgeplf commented Oct 30, 2024

@addisonElliott > New major release pending

Any update on this? Do you have a timeline on when the new release would happen?
Thanks for your hard work.

@addisonElliott
Copy link
Collaborator

Sorry, I've been meaning to find the time to do that. Hopefully this weekend or next week. I have another feature I want to merge in and do a minor release.

I was going to do a major release, but I think it's a minor enough change that a minor will suffice.

@mgeplf
Copy link

mgeplf commented Nov 1, 2024

Sorry, I've been meaning to find the time to do that.

No problem and thanks for the update.

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

No branches or pull requests

3 participants