-
Notifications
You must be signed in to change notification settings - Fork 307
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
Implemented a function for smarter debug formatting. #606
Merged
LukeMathWalker
merged 31 commits into
rust-ndarray:master
from
andrei-papou:smart-debug-formatting
Apr 26, 2019
Merged
Changes from 7 commits
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
fe4365c
Implemented a function for smarter debug formatting.
2450f50
Fixed existing tests
3474d3f
Some fixes:
2a8a7c7
Implemented axis shrinking for n-dim arrays
1b5da67
All the PR issues are fixed. Tests are needed.
fbf8cac
Fixed the tests
51c4e11
Added tests for 1- and 2-dimensional array with overflow
0d11708
Try to fix 1.31 build failing
18c868a
PRINT_ELEMENTS_LIMIT is now private
3aa8abe
Remove dead code
LukeMathWalker 17f86bb
Rename format_array_v2 to format_array
LukeMathWalker d48c5a9
Simplify code using ndim
LukeMathWalker 6c636dc
Access last element directly
LukeMathWalker 88d53e3
Add a test to specify behaviour for zero-dimensional arrays
LukeMathWalker b962a7b
Add a test for empty arrays
LukeMathWalker 29a8f70
Test zero-length axes
LukeMathWalker 27c4a92
We already know that ndim > 0
LukeMathWalker 49b4338
Merge pull request #2 from LukeMathWalker/smart-debug-formatting-review
b535f28
Made the formatting logic more modular
2a8a3b0
Simplify element access
5fd9b2f
Almost there
f60185c
Clone for the win
198d689
Cast to 1d array
c1036fb
First and last elements have to be special cased. Done for multidimen…
5336b10
Extract in a separate function
4fa8a62
Tests are passing
e659390
Minor improvements
0abff2a
Formatting
e049abd
Remove closure
83c9f08
Use custom enum
72e05d7
Merge pull request #3 from LukeMathWalker/refactoring-smarter-debugging
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
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
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.
I'd refer to not reexport this public constant at the top level of the crate, but rather reexport it from some
config
orintegration_test
module.As far as I can tell the motivation for making it
pub
is entirely for making it usable within the integration tests attests/format.rs
?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.
Fixed
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.
Awesome. I think that's better. I understand your motivation to have a way of configuring formatting similar to numpy's
set_printoptions
, but we wouldn't be able to actually accomplish that throughconst PRINT_ELEMENT_LIMIT
. I am actually not sure right now if that was possible at all for a user of the library to accomplish at compile time.