-
-
Notifications
You must be signed in to change notification settings - Fork 31
What needs to be done before merging the stubs into NumPy #79
Comments
I'd like to branch 1.19 next weekend, so time is short. If you feel it would be pushing things to be ready at that point it would be best to wait for 1.20. @rgommers Thoughts? |
Oh yeah, I definitely wasn't thinking of doing it for 1.19. I was thinking of early in 1.20 so that we have lots of time to try and get it right before a release. |
SGTM! |
Do we need to mark/make it preliminary for a while? And if, how should that look like? |
Yeah that's a good point. I think that it will need to be preliminary certainly in the first release and perhaps for much longer-it might depend on whether we can think of a good back-compatibility story for going from I can't think of a way to mark the types as experimental beyond loud warnings in the documentation/release notes though. |
The only true thing we could do is make it |
Ok, I'm going to tentatively say I'll try to start the migration to the main NumPy repo next weekend. If it's ok I think I'll punt on the In the meantime I'll try to wrap up a some open issues and PRs in this repo. |
I've created a milestone: https://github.com/numpy/numpy-stubs/milestone/1 tracking things I want to resolve before the migration, in case anybody wants to see the more detailed plan there. |
I think this should be achievable by just marking the shape somewhat like |
@ethanhs can you say more about this? The reason I thought we would have problems is that something like this doesn't work: from typing import Generic, TypeVar
Dtype = TypeVar('Dtype')
Shape = TypeVar('Shape')
class ndarray(Generic[Dtype, Shape]): pass
a: ndarray[int] = ndarray() We get the error:
My understanding was that we could work around the above issue with a plugin though. But hopefully I'm just missing something! |
@person142 I imagine that a plugin would simply insert |
Going to close this and open a new issue with concrete steps planned for the migration. |
Exactly, you can define even convenient aliases that eliminate the need for any boilerplate, e.g., Array = ndarray[Dtype, Any]
|
A couple of months ago I argued against merging the stubs into NumPy right away so that we could keep a tighter iteration loop with SciPy. Now that we are close to getting an initial version of
ArrayLike
over in #66 I think the situation becomes different.As I see it, the next big challenge will be making
ndarray
generic over dtype. After a lot of good discussion with @seberg over in #48 it seems like the path forward there likely involvesIf that is the case, then the stubs being merged into NumPy becomes an advantage because we will be relying on unreleased features.
What do people think? Should we try to merge the stubs into NumPy soon? It might behoove me to finish writing the prototype dtype plugin to see if it will actually work like I think it will.
The text was updated successfully, but these errors were encountered: