Automatic units in monitor for large quantities
See original GitHub issueWould it be possible to support automatic unit conversion, similar to how tqdm implements this?
unit
: str, optional String that will be used to define the unit of each iteration [default: it].unit_scale
: bool or int or float, optional If 1 or True, the number of iterations will be reduced/scaled automatically and a metric prefix following the International System of Units standard will be added (kilo, mega, etc.) [default: False]. If any other non-zero number, will scale total and n.
Issue Analytics
- State:
- Created 3 years ago
- Comments:16 (13 by maintainers)
Top Results From Across the Web
Large Cuff Blood Pressure Monitor for Big Arms, 5.56 ...
Large Cuff Blood Pressure Monitor for Big Arms, 5.56-18.96 Inche XL Size Automatic Blood Pressure Machine for Adult, Measuring BP & Heart Rate...
Read more >Configure Monitors - Datadog Docs
Alerts are grouped automatically based on your selection of the group by step when defining your query. Grouping defaults to Simple Alert ....
Read more >Monitor: Automatic intelligent inspection for hardware ...
For this use case, Monitor examines every new unit on the line, compares it to normal past units, and triages anything unusual for...
Read more >Blood Pressure Monitors & Cuffs - Omron Healthcare
Nearly 1 out of every 2 adults in the United States has high blood pressure, but you can help get to the heart...
Read more >SIMATIC Industrial Monitors and Thin Clients - Siemens
Distance from IPC: up to 5 m (Standard), up to 100 m with HDBaseT module (Extended) or Ethernet cable (Ethernet) · Extremely high-quality,...
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 FreeTop 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
Top GitHub Comments
Hey @Jasonzyt, not yet, I couldn’t even commit it yet! It’s still all on my laptop here, but it is completely ready. I’ll try to finalize it asap 👍
Hi @rsalmei, I see what you mean, but consider the following scenarios:
I am counting something (say
S
units) that I don’t care much about the specific number, just a rough idea would be fine. Since it goes into thousands/millions, I am fine with an auto-scaling. Therefore, I useunit=S
and wish that it auto-scales1850000S
to1.85MS
. In this case,alive-bar
must default to auto-scaling and a1000
unit scale parameter, i.e. a kilo-unit means 1000 of that unit.I want to configure the bar to display bytes downloaded. This scenario is quite similar to the one above, except that
unit_scale=1024
. You could code theunit
parameter to scale to1024
whenunit=B
orunit=b
, but I think that it loses generality.I want to configure the bar to display an iteration counter that goes up to thousands. Maybe in this case I want to actually see at which iteration I am at a given moment with precision, so
unit=it
(for iterations) butunit_scale=1
meaning that I don’t want it to scale with SI prefixes. In this case I actually want to see1850000 it
.With all that said, I do think that the two configurations are needed, both
unit
andunit_scale
, especially since the user can wish to scale with esoteric bases/factors other than 10 and 2.It could be that the default is that when
unit
is given andunit_scale
is not, it assumes base 10 and auto-scaling with SI-prefixes.What do you think?