-
Notifications
You must be signed in to change notification settings - Fork 46
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
Open
brendanjohnharris
wants to merge
30
commits into
rafaqz:main
Choose a base branch
from
brendanjohnharris:stack
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 18 commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
4ea5e40
Extend Base.stack to DimArrays
brendanjohnharris ec3b2cf
Initial Base.stack tests
brendanjohnharris 0b762ce
Fix whitespace changes
brendanjohnharris 6affd9b
Merge branch 'stack' into stacker
brendanjohnharris ac3affc
Clean up Base.stack, add docstrings, add tests
brendanjohnharris 83ace60
Fix Base.stack docstring
brendanjohnharris e6cfb1b
New Pair syntax for extended Base.stack
brendanjohnharris ce16068
Better Base.stack formatting
brendanjohnharris bdf151f
Tweak docstring for Base.stack, remove kwargs
brendanjohnharris 7a4cf26
Merge branch 'rafaqz:main' into stack
brendanjohnharris 3314852
Update whitespace
brendanjohnharris 0ac2eb0
Fix whitespace
brendanjohnharris 884ab68
Fix whitespace
brendanjohnharris c369d06
use rebuild
rafaqz 2c7b8b9
rebuild
rafaqz cf57f86
Merge branch 'rafaqz:main' into stack
brendanjohnharris 0a278a6
Update Base.stack tests
brendanjohnharris f41f424
Rework Base.stack
brendanjohnharris d9ee5e7
Update Base.stack to accept dims<:Dimension
brendanjohnharris 9b3b3b7
Improve Base.stack tests
brendanjohnharris 25dc8a2
Add test for Base.stack with symbol dims
brendanjohnharris e2aeb0e
Replace accidentally deleted line for Base.stack
brendanjohnharris 39c78e8
Update Base.stack for symbol dims
brendanjohnharris 16c205a
Fix typo
brendanjohnharris 15cc9fd
Avoid dispatching on Base._stack
brendanjohnharris 52ce34a
Update tests
brendanjohnharris f868ddf
Update test with error on out-of-range dims
brendanjohnharris 911acda
Update _maybe_dimnum to error if specified Integer dims are too large
brendanjohnharris 9517d16
Use map instead of dot broadcast
brendanjohnharris b329519
Update reference.md
brendanjohnharris File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
Oops, something went wrong.
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.
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.
This should allow passing Dimension/Symbol etc
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 about:
This helps because the default
dims
in Base'sBase.stack
is (oddly)dims=:
. This has the same effect asdims=ndims(first(iter))+1
, as far as I can tell, but it doesn't play well withdimnums
in this context.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.
Try to avoid dispatch on the underscore as much as possible... And we also need to accept Symbol. I would just define another method like
_maybe_dimnum
that has dispatch for Colon and Int that don't call dimnum and everything else usesdimnum