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.

[REQUEST] Remove degree symbol from Kelvin temperature unit.

See original GitHub issue

Problem:

Temperatures in Kelvins have a degree symbol in front of them, which shouldn’t be there given Kelvin is an absolute measure. I recognize that this is quite pedantic, but it bugged me, and maybe others.

Solution:

It seems that the degree symbol is defined in one place, so it would be an extremely simple fix of just replacing “°K” with "K ". The space is added such that assertions involving ProcBox.width should still pass and the same horizontal space is used.

Potential reasons not to implement this:

  • It could have been purposely defined this way as not to confuse "K " with a shorthand sometimes used for kB. However, I personally think that this confusion is unlikely given the context should make clear that it regards temperature.

  • Such a minor change doesn’t warrant a PR.

  • “Why are you wasting my time with your pedantry?” 😃

Additional context:

If desired a PR is ready (which however fails on 2 tests for 3.7, 3.8, 3.9; see below).

test_Box_calc_sizes() and test_NetBox_draw() seem to fail when running tox with the change. However, they also seem to fail for the current master branch although this might be an error on my part:


================================================================================= FAILURES =================================================================================
___________________________________________________________________________ test_Box_calc_sizes ____________________________________________________________________________

    def test_Box_calc_sizes():
        Box.calc_sizes()
>       assert CpuBox.width == MemBox.width + ProcBox.width == NetBox.width + ProcBox.width == 80
E    assert (36 + 44) == (80 + 44)
E     +  where 36 = MemBox.width
E     +  and   44 = ProcBox.width
E     +  and   80 = NetBox.width
E     +  and   44 = ProcBox.width

tests/test_classes.py:23: AssertionError
_____________________________________________________________________________ test_NetBox_draw _____________________________________________________________________________

    def test_NetBox_draw():
        Box.calc_sizes()
>       assert len(NetBox._draw_bg()) > 1
E    AssertionError: assert 0 > 1
E     +  where 0 = len('')
E     +    where '' = <bound method NetBox._draw_bg of <class 'bpytop.NetBox'>>()
E     +      where <bound method NetBox._draw_bg of <class 'bpytop.NetBox'>> = NetBox._draw_bg

tests/test_classes.py:123: AssertionError

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
jrbergencommented, Apr 26, 2021

@aristocratos

Great, then it was indeed some weirdness caused by some venv magic.

You’re very welcome. This was my first PR so it was nice to try out and see how that works with a small change. I really like bpytop so once I’ve scraped some items of my way too full to-do list I hope I can contribute more.

I’ll close this issue now.

1reaction
aristocratoscommented, Apr 26, 2021

@jrbergen The setup for tox should be to just pip3 install it and then run it. But you’ll need python 3.7, 3.8 and 3.9 installed for tox to run all tests. (I think that should be all, was a while ago I set it up…)

You can also run it through poetry for a fast test in the current environment. Just pip3 install poetry and then run poetry update and poetry run pytest.

We can leave this open, and then when you submit the PR link it to this issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Remove a temperature degree symbol - Stack Overflow
I have imported a .csv file that was output from a program and it uses the degree symbol when describing temperature units.
Read more >
Why do most style guides miss out the 'degrees' when ...
Everyone uses the word 'degrees' when talking about temperature, and it's not like the degree symbol takes up an inordinate amount of space...
Read more >
Degree Symbol ° – Degree Symbol ° – (0167) Alt code, Copy ...
Take the Kelvin temperature and drop 273.15. Your answer will be in degrees Celsius. Although there is no symbol for Kelvin degrees, you...
Read more >
Why do we not use the sign of degree in Kelvin but ... - Quora
The symbols C and F have other uses (Coulombs, Farads) but K does not. So its necessary to use the degree or degree...
Read more >
Add degree symbol to temperature values #177 - GitHub
Hey, the correct unit symbols for temperatures are "°C" and "°F" so I added the degree ... REQUEST: Add maintainers & remove deprecation...
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