question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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:open
  • Created 6 years ago
  • Reactions:1
  • Comments:9 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
eerovahercommented, Mar 21, 2022

What to do with array-valued quantities.

This code in the Distance constructor uses the mean of the array: https://github.com/astropy/astropy/blob/da206faba923db66e53aac29450dd57cea211cc0/astropy/coordinates/distances.py#L132-L143

0reactions
adonathcommented, Mar 21, 2022
  1. What to do with composite units like km/s

I 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.

  1. What to do with array-valued quantities

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found