[Fix #6981] RDisplay::Print to show more elements from collections - #9095
[Fix #6981] RDisplay::Print to show more elements from collections#9095ikabadzhov wants to merge 5 commits into
Conversation
…llections AddCollectionToRow() modified so that the first 10 elements of long collections are to be printed, then followed by "...". Previously, only the first and last elements of collections of size >=3 were printed. Print() logic is now simplified, since after "..." there is no guarantee that there is going to be a next element. Current unitt tests were adapted and a new one is added, to test showing elements around the treshold, i.e. <10, 10, 11, >11. Regarding root-project#6981 - to display the whole collection, please use AsString().
|
Starting build on |
There was a problem hiding this comment.
Looks good, great job!
Should we expose nMaxCollectionElements as a parameter of Display? (with a default value of 10 or 16?)
Also before merging please give this commit a clang-format pass. It should be something like git clang-format HEAD to only format the changes from your commit and not the whole files.
EDIT: from the CI failure it also looks like there is some adjustments still to do in the tests
| std::vector<int> v0 (0); | ||
| std::vector<int> v1 (1, 0); | ||
| std::vector<int> v3 (3, 0); | ||
| std::vector<int> v9 (9, 0); | ||
| std::vector<int> v10 (10, 0); | ||
| std::vector<int> v11 (11, 0); | ||
| std::vector<int> v20 (20, 0); |
There was a problem hiding this comment.
slightly better imho (not that it changes anything in practice):
| std::vector<int> v0 (0); | |
| std::vector<int> v1 (1, 0); | |
| std::vector<int> v3 (3, 0); | |
| std::vector<int> v9 (9, 0); | |
| std::vector<int> v10 (10, 0); | |
| std::vector<int> v11 (11, 0); | |
| std::vector<int> v20 (20, 0); | |
| const std::vector<int> v0; | |
| const std::vector<int> v1 (1); | |
| const std::vector<int> v3 (3); | |
| const std::vector<int> v9 (9); | |
| const std::vector<int> v10 (10); | |
| const std::vector<int> v11 (11); | |
| const std::vector<int> v20 (20); |
There was a problem hiding this comment.
Thanks. I have just fixed the vector creation in the tests and before committing used clang-format. To me, keeping nMaxCollectionElements local to the AddCollectionToRow() makes sense since it is the only method that needs this constant.
Locally ctest -R "(dataframe|datasource)" -- -j4 passes all (121) tests.
There was a problem hiding this comment.
To me, keeping nMaxCollectionElements local to the AddCollectionToRow() makes sense since it is the only method that needs this constant.
it's to let users pick a higher value if they want to
Locally ctest -R "(dataframe|datasource)" -- -j4 passes all (121) tests.
ok, let me see if I can reproduce the jenkins failures locally
There was a problem hiding this comment.
fails for me locally (and it does not look like something that can depend on the platform). Make sure you don't have uncommitted changes (e.g. with git stash), rebuild and try running ./path/to/build/tree/dataframe/test/dataframe_display
|
Build failed on mac1014/python3. Failing tests: |
|
Build failed on ROOT-ubuntu16/nortcxxmod. Failing tests: |
|
Starting build on |
|
Build failed on mac1014/python3. Failing tests: |
|
Build failed on ROOT-ubuntu16/nortcxxmod. Failing tests: |
|
Build failed on ROOT-performance-centos8-multicore/default. Failing tests: |
|
Starting build on |
|
Build failed on mac11.0/cxx17. Failing tests: |
|
Build failed on windows10/cxx14. Failing tests: |
|
Starting build on |
|
Starting build on |
|
Build failed on ROOT-ubuntu16/nortcxxmod. Errors:
|
|
Build failed on ROOT-ubuntu2004/soversion. Errors:
|
|
Build failed on ROOT-performance-centos8-multicore/default. Errors:
|
|
Build failed on mac11.0/cxx17. Errors:
|
|
Build failed on mac1014/python3. Errors:
|
|
Build failed on ROOT-debian10-i386/cxx14. Errors:
|
|
@phsft-bot build please |
|
Starting build on |
|
Build failed on ROOT-performance-centos8-multicore/default. Errors:
|
|
Build failed on ROOT-debian10-i386/cxx14. Errors:
|
|
Build failed on ROOT-ubuntu2004/soversion. Errors:
|
|
Build failed on ROOT-ubuntu16/nortcxxmod. Errors:
|
|
Build failed on mac11.0/cxx17. Errors:
|
|
Build failed on mac1014/python3. Errors:
|
|
superseded by #9105 |
This Pull request:
[Fix #6981] RDisplay::Print to show more elements from collections
Changes or fixes:
AddCollectionToRow() modified so that the first 10 elements of long collections
are to be printed, then followed by "...". Previously, only the first and last
elements of collections of size >=3 were printed.
Print() logic is now simplified, since after "..." there is no guarantee
that there is going to be a next element.
Current unit tests were adapted and a new one is added, to test showing
elements around the treshold, i.e. of <10, 10, 11, >11 elements.
Regarding #6981 - to display the whole collection, please use AsString().
Checklist:
This PR fixes #6981