Feature request: method for human readable units
See original GitHub issue(from discussion with @adrn at PyData2017 NYC)
Would like to automatically determine the units for a quantity so it’s more human readable. For example, Googling “100000000000 bytes” (https://www.google.com/search?q=100000000000 bytes) returns 100 GB automatically.
Currently, this functionality only exists if the desired units are specified, i.e., (100000000000 * u.m).to(u.Gm)
, but it would be convenient to have a function that automatically converted (100000000000 m).human_readable()
to 100 Gm.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:9 (8 by maintainers)
Top Results From Across the Web
Feature request: A more accurate .humanize #348 - GitHub
I understand that we don't often want this level of accuracy but sometimes we do want the exact value in a human readable...
Read more >Feature request response email templates - LiveAgent
Feature requests are messages that customers send to inquire about a feature that is not included in your product or service. Receiving feature...
Read more >Read/write capacity mode - Amazon DynamoDB
DynamoDB charges you for the reads and writes that your application performs on your tables in terms of read request units and write...
Read more >Convert time interval given in seconds into more human ...
Translates seconds into human readable format of seconds, minutes, hours, ... and short way to retrieve a human readable time with only a...
Read more >Feature Requests - DEAR Support Team
Feature 1: Customisable BOM's that can be easily edited during the pick/pack stage. The part substitute feature right now doesn't really work very...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
This code in the
Distance
constructor uses the mean of the array: https://github.com/astropy/astropy/blob/da206faba923db66e53aac29450dd57cea211cc0/astropy/coordinates/distances.py#L132-L143I agree this is tricky. I think it would require to manually assign priorities / weights to prefixes, effectively making it an optimization problem. But this might be highly specific on the domain as well. In any case supporting this for
PrefixUnit
only would already be useful.If all numbers are in the same range the mean should work fine. If the numbers vary by multiple orders of magnitudes it might work as well, but not necessarily. Alternatively one could do a “democratic decision” and take the preferred unit that works for the “majority” of entries in the array.