-
Notifications
You must be signed in to change notification settings - Fork 369
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
update manual and docstrings to PrettyTables.jl #2522
update manual and docstrings to PrettyTables.jl #2522
Conversation
This should be good for a review. In general you can expect that this PR does not change anything. What I do:
In general I have used this PR to make sure all doctests pass before the release. |
Co-authored-by: Milan Bouchet-Valat <[email protected]>
@ronisbr - there are two things to dicsuss left in this PR. Can you please have a look at them? Thank you! |
Co-authored-by: Milan Bouchet-Valat <[email protected]>
…into update_documentation_printouts
I have updated the example with overwide column that caused cropping |
@bkamins beside that question of float pointing alignment, is there anything else? Everything looks good to me! |
No - all is clean. I have opened #2525 to keep track of to-do, but it is for later (you are probably best to lead these changes). Also @nalimilan commented that the 32 char column width limit might be reconsidered, but this is for later. The question is if it is possible to do something like:
(I assume this is tricky to do correctly, especially if you have more than one column that hits this problem, so I guess both @nalimilan and I think that it is for later) |
I am guessing here, since I really did not analyze the code, but maybe an |
Thank you. I think it is not a super pressing feature. Adding HTML and LaTeX for consistency are more of the priority (if you have the stamina for this). I hope you enjoyed the work - all JuliaData community really appreciates what you have done. |
Ok! I will focus in HTML and LaTeX. We are not too far from a stable version, but there is a lot of tests to add.
I really did! I would like also to thank you and @nalimilan, because PrettyTables.jl is much better now after all the modifications :) |
Yes the 32-char limit is much lower priority than aligning float columns to the right IMHO. If possible I'd like to get the latter in 0.22, but the former can wait. |
@nalimilan - why do you think it is that important? |
For consistency with integers, and because that's what all other software does (Excel, dplyr...). But the main reason I think it deserves to be in 0.22 is that it's better to avoid breaking doctests of other packages too frequently (other than that it could perfectly wait for a later release). |
To keep the right alignment, we need to compute the field size. In the current implementation, we would need to convert the float columns to string twice (inside DataFrames and inside PrettyTables). This can decrease the performance. The solution to this is adding an API to post process the table after the conversion of the matrix to strings. However, this will take time to design. Hence, we have three possible solutions:
|
@nalimilan - I vote for this option. I would prefer @ronisbr to design a general solution for alignment in PrettyTables.jl first so that we do not have to use hacks in DataFrames.jl. As for option 3 - I think that decimal alignment is a priority, so I would rule it out. Two side comments:
Finally - we consider display changes non breaking, and such a change in the future, while requiring depending packages to update their docstrings is minor (even if these packages do not update the docstrings the difference will be minimal visually). So in summary - given the situation I vote for leaving things as they are now, as @ronisbr already put massive work into these things. We can update it later when @ronisbr updates PrettyTables.jl to allow for flexible alignment changes. @nalimilan - but if you would still prefer solution #1 then I understand it is doable, and I am OK with waiting till the workaround is implemented before 0.22 release, so please let us know how you see this. |
Thanks for investigating this @ronisbr. With the goal of minimizing disruptions for users (because doctests can make tests fail even if printing is not part of the API), I'd be inclined to try solution 1 if you feel like it's doable reasonably soon and without doing too much work that you'll have to undo once we have a better solution. But if you feel it's not worth it then we can change that after 0.22. |
OK - so if @ronisbr agrees let us go for option 1 that is less performant (doing floating processing twice) and hope that in the future PrettyTables.jl is upgraded to do if faster. @ronisbr - is this OK with you? If yes - can you please open a PR with the fix? Then I will rebase this PR after the other is merged (this means that in your PR only update tests and docstrings for (an alternative would be to merge this PR and then you could update only the outputs that get changed after your fix - we can go also this way if you would prefer it) |
I think I can take a look by this weekend! Then I let you know if the downsides are that bad 😄 I prefer submit a PR and then you update this one, if you don’t mind. |
Sure - no problem. So I am waiting for your PR. Thank you! |
@nalimilan + @ronisbr I have updated this PR after floating point alignment change. I have caught another case of Hopefully this should be good to merge. I have bumped version to 0.22 here so when this PR is merged I will make a release (unless you object 😄). |
Thank you! We are going for 0.22 release now! |
I have done the manual. I will continue with docstrings tomorrow.