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.
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
Extending Base.stack for DimArrays #645
base: main
Are you sure you want to change the base?
Extending Base.stack for DimArrays #645
Changes from all commits
4ea5e40
ec3b2cf
0b762ce
6affd9b
ac3affc
83ace60
e6cfb1b
ce16068
bdf151f
7a4cf26
3314852
0ac2eb0
884ab68
c369d06
2c7b8b9
cf57f86
0a278a6
f41f424
d9ee5e7
9b3b3b7
25dc8a2
e2aeb0e
39c78e8
16c205a
15cc9fd
52ce34a
f868ddf
911acda
9517d16
b329519
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
What happens with
dims=Z
?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.
Currently,
dims=Z
(where Z is not a dimension in the DimArrays being stacked) falls back to adding the new dimension at the end (so the result is the same as for the default behavior):Should we throw an error instead, like when an out-of-range Integer dim is give? I.e.:
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.
I was thinking we should add a dimension like it is currently, but we can set it to be a
Z
dimensionThere 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.
Using the current minimal approach, stacking with a new dimension
Z
would be:We could have this behavior be automatic (without overloading
Base._stack
) with:But I wonder if it could be confusing to have this different behavior for when
dims <: Dimension
andhasdim(x, dims)
(the new dimension is inserted beforedims
but keeps the original name) versus!hasdims(x, dims)
(the new dimension is inserted at the end and renamed todims
); it also means the return type can't be inferredThere 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.
I'm not sure we are understanding each other... My only ask here was that this new dimension is a
Z
dimension ifdims=Z
was used