Uh oh!
There was an error while loading. Please reload this page.
Implemented a function for smarter debug formatting. - #606
Conversation
| #[derive(Debug)] | ||
| enum ArrayDisplayMode { | ||
| // Array is small enough to me printed without omitting any values. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
LukeMathWalker
commented
Mar 25, 2019
The output looks quite nice! |
- fixed typo in ArrayDisplayMode comment - updated ArrayDisplayMode constructor to use shape instead of array - fixed output for complex dimensions
| mod arrayformat; | ||
| mod data_traits; | ||
| pub use arrayformat::PRINT_ELEMENTS_LIMIT; |
There was a problem hiding this comment.
I'd refer to not reexport this public constant at the top level of the crate, but rather reexport it from some config or integration_test module.
As far as I can tell the motivation for making it pub is entirely for making it usable within the integration tests at tests/format.rs?
There was a problem hiding this comment.
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 through const 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.
SuperFluffy
commented
Mar 27, 2019
I personally don't like that the implementation detail |
andrei-papou
commented
Mar 27, 2019
@SuperFluffy I can move them to Although I agree that those tests should be unit tests, it would be good to give a user some control over |
andrei-papou
commented
Apr 8, 2019
@LukeMathWalker@SuperFluffy any more comments on the changes? I think all the previous issues are fixed |
LukeMathWalker
commented
Apr 12, 2019
Sorry for the late reply @andrei-papou, it has been a crazy week. |
LukeMathWalker
commented
Apr 16, 2019
I have opened a PR with some observations @andrei-papou. |
andrei-papou
commented
Apr 17, 2019
@LukeMathWalker I tried to make the function more modular by extracting parts of the functionality to other functions and by reducing the number of boolean flags. I also got rid of the explicit second for loop. I hope the code is a bit more readable now. Please take a look |
LukeMathWalker
commented
Apr 23, 2019
I have opened a PR on your branch, trying out a different approach to solve this issue @andrei-papou - let me know what you think of it. |
LukeMathWalker
commented
Apr 25, 2019
I am happy to merge this into master. Do you want to have a look @jturner314? |
jturner314
commented
Apr 25, 2019
@LukeMathWalker Sure, I'm happy to review it, but feel free to go ahead and merge it if it looks good to you. I won't be able to review it until late next week or so. (It's the end of the semester right now, so I'm busy with exams.) Thanks for working with @andrei-papou on this PR. |
LukeMathWalker
commented
Apr 26, 2019
I am happy to call the shots and go ahead with this one - I'd like to avoid consuming your time on PRs I am confident reviewing (we need it for all the others were I have little context 👀). |
jturner314
commented
Apr 26, 2019
Thank you. :) |
PR for #398
How it works:
The number of elements before ellipses is managed by the
PRINT_ELEMENTS_LIMITconstant.