-
Notifications
You must be signed in to change notification settings - Fork 137
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
improve size column readability in archives tab #1598
Conversation
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.
Please add signature type hints and docstrings for pretty_bytes
and find_best_size_formatting
.
Pre-commit will format your code (including sorting imports) automatically. |
unfortunately pre-commit is not working on my system, this is the error I receive: [Edit] ok this problem is related to #1601, so i've been able to install and run it by doing the |
It won't since the corresponding PR is not merged yet. |
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.
Great, you added test cases and cleverly improved my code!
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.
Can you add a test for a very large size like
it was failing actually :) |
Co-authored-by: yfprojects <62463991+real-yfprojects@users.noreply.github.com>
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.
Only some minor typing problems which make them even more minor.
Co-authored-by: yfprojects <62463991+real-yfprojects@users.noreply.github.com>
Thanks all! Give me until this evening to run this locally. |
Works as advertised. Interesting addition. Thanks for your work and patience on this! |
I find hard to read the sizes of the archives at a glance when they are all mixed units: usually the longer numbers represent smaller sizes, making it difficult to find the biggest archives. So I made a basic algorithm to select a good unit that can adequately represent all sizes, that makes it much easier to read. Also I made the column align to the right, which further improves readability.
Related Issue
#1595
Motivation and Context
Readability
How Has This Been Tested?
Tested on my archive list, which sizes goes from about 100 MB to 150 GB
Screenshots (if appropriate):
Types of changes
Checklist:
I provide my contribution under the terms of the license of this repository and I affirm the Developer Certificate of Origin.