[REQUEST] Remove degree symbol from Kelvin temperature unit.
See original GitHub issueProblem:
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:
- Created 2 years ago
- Comments:5 (3 by maintainers)
Top GitHub Comments
@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.
@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 runpoetry update
andpoetry run pytest
.We can leave this open, and then when you submit the PR link it to this issue.