Draft
Conversation
Also makes private typing names 'public' by removing leading _
a2d5512 to
a96fc0a
Compare
Collaborator
Author
|
Are there any objections to this approach? If not I will wrap this up and fix all remaining issues. Next step is to incorporate the same changes into Variable in a follow up PR. |
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
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.
This PR introduces a new Generic TypeVar for dimension names.
This hopefully removes some typing annoyances for 99% of the people that use only str dimension names.
Now
NamedArray("x", [1, 2, 3]).dimsis actually typed astuple[str, ...]and nottuple[Hashable, ...]anymore :)This is a breaking change for typing of
NamedArray.The type changes from
NamedArray[ShapeType, DType]toNamedArray[ShapeType, DType, DimType]Currently this only passes
mypy -m xarray.namedarray.Just wanted to see how much work it is to change that.
If it is decided that we want to go on with this change I will fix the rest of xarray and potentially create follow up PRs to propagate that change to
DataArrayandDatasetas well.Note: I quick and dirty edited the _aggregations file. This has to be done more properly later...