-
-
Notifications
You must be signed in to change notification settings - Fork 11.1k
MAINT: Simplify block implementation #9667
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
a5c6f0d
Simplify block implementation
j-towns 2dcc9aa
np.block style improvements
j-towns e787a9f
Reflect asanyarray behaviour in block
j-towns 95adb77
Add empty list comment to block depth check
j-towns 07a3f43
Use strict type checking (not isinstance)
j-towns 19fc68c
Re-add tuple type-check comment
j-towns 997ac2c
Re-add `atleast_nd` function.
j-towns 7eb1044
Add detailed comment to _block_check_depths_match
j-towns ff7f726
Extend comments _block_check_depths_match
j-towns 6ecd2b4
Try not recomputing list_ndim
j-towns 1211b70
Slight simplification to logic
j-towns ffa6cf6
Add two tests for different arr_ndims
j-towns 3ed6936
Simplify further - matching docstring logic
j-towns 5f9f1fa
Rename list_ndim to max_depth
j-towns 8a83a5f
rm extra line from near top of shape_base
j-towns 5a0557a
Pre-calculate max array ndim
j-towns c2b5be5
Further slight simplifications
j-towns bd6729d
Update block docstrings
j-towns ad278f3
Fix python 3.4 sequence error
j-towns 2c1734b
Correct empty list ndim
j-towns eaddf39
Avoid using zip(*...) syntax
j-towns a5cbc93
Use builtin next method
j-towns a691f2d
Rm unnecessary enumerate
j-towns 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
Re-add
atleast_nd
function.
- Loading branch information
commit 997ac2cfbe3edba968e1ee140763b53b88c3afca
There are no files selected for viewing
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
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.
It makes me a little uneasy that this happens inside the recursion - I think there aren't many tests for block with different dimensioned arrays.
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've simplified the logic a little and added two tests for cases where arr_ndim > list_ndim and the inner arrays have different ndims.