-
-
Notifications
You must be signed in to change notification settings - Fork 10.8k
MAINT: Refactor of numpy/core/_type_aliases.py
#24679
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
Conversation
6b413f6
to
dd1f9f1
Compare
67bafb9
to
4e77ba6
Compare
Hi @seberg, I've got two questions regarding remaining checks that failed:
|
Hmmm, I thought this was already being pushed forward/through, while I was out.
Just use
I guess we could add the |
I would really like this to move forward, because I started looking into changing the definition for |
4e77ba6
to
e318f0a
Compare
@seberg Thank you for feedback! For now I will include these extended precision sized aliases based on |
This could probably be simplified more by using `np.dtypes` or merging some of the information there, but this is a big first step of removing logic duplication and just removing a lot of exposed info that nobody needs.
681abe0
to
6998983
Compare
Hi @seberg, I pushed a new commit - here are my comments:
|
I don't know why it is not showing up in the summary, but there is a test failure on azure. |
Huh, the link you provided is from different PR ( |
6998983
to
3968009
Compare
Ok, now azure stages are running - CI is green. |
Are you OK making the bitsized longdouble aliases generate deprecation warnings in a followup? |
Are you asking me or @mtsokol, TBH, whether or not we do it, it is nice as a follow-up any case. It might be good if someone other than me can have a quick look as I wrote the C changes. I didn't have a close look yet (or at least recently), but I suspect the changes are fine. |
I was asking Mateusz since that was the only ask in the reviews that wasn't addressed. Thanks for the context though. I looked over the C changes earlier and didn't see any issues. I'll give them another once-over before merging. |
Sure! I will deprecate these aliases in the next PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It appears this removed some previously In [1]: import numpy as np
In [2]: np.dtype("unicode")
Out[2]: dtype('<U')
In [3]: np.__version__
Out[3]: '1.24.4' >>> import numpy as np
>>> np.dtype("unicode")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: data type 'unicode' not understood
>>> np.__version__
'2.0.0.dev0+git20231007.040ed2d' |
I think that was missed, can you open an issue? |
|
Here's an issue: #24892 |
Hi @seberg @rgommers,
This is a successor for #24651 PR. It focuses on refactoring both C and Python code that defines types and aliases.
_type_aliases.py
importstypeinfo
and moves types toallTypes
andsctypeDict
without the old logic, such as recalculating bit sizes etc.Here,
allTypes
contains concrete type names that are available in the main namespace and abstract types (also placed in the main namespace).sctypeDict
contains concrete type names and additional aliases that are used bynp.dtype
(e.g.np.dtype("long")
ornp.dtype("int")
).sctypes
is exactly the same as before.The only thing left is the refactor of
numpy/f2py
test suite, as it uses originaltypeinfo
quite extensively. The rest of the test suites pass successfully on my machine.