fix #2951 Use a thin space to indicate groups of 1000s in html/cli print out#3167
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #3167 +/- ##
=======================================
Coverage 89.62% 89.62%
=======================================
Files 28 28
Lines 31955 31965 +10
Branches 5872 5873 +1
=======================================
+ Hits 28639 28649 +10
Misses 1886 1886
Partials 1430 1430
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
jeromekelleher
left a comment
There was a problem hiding this comment.
LGTM. I guess the only downside of this is that people copying these numbers from the text won't get quite what they want. But, it that's just on pretty printing, that's OK?
benjeffery
left a comment
There was a problem hiding this comment.
Just needs a fix for the tests. (I added a "fixes" tag to the PR description as it auto-closes the issue on merge)
| f"{util.format_number(counts[k])} ({ | ||
| util.format_number(freqs[k] * 100, 2)}%)", | ||
| ] |
There was a problem hiding this comment.
This split is causing the module to fail to import.
There was a problem hiding this comment.
yes, I also had to change the regex of test_highlevel.py::TestTree::test_str to match the new format; please check that also @benjeffery
f4e000d to
9b3b89c
Compare
|
I can change the separator to a comma for the cli, just confirm this with me before I implement it @benjeffery |
|
Yep! |
|
Agree this is the right approach |
9b3b89c to
41b54f0
Compare
|
Is there a way to add squishing different commits to the workflow before merging rather than doing it manually? then if more changes are to be done we wont have to squish again (and I just hate to force push)? |
There's two approaches to this, depending on context.
You should not be scared of force pushing at all, nothing is lost as all the previous states of your branch will be in the reflog. (You can see them with I force push about 50% of the time, it is a normal part of the workflow. |
|
@benjeffery another review? |
benjeffery
left a comment
There was a problem hiding this comment.
Looks good - a couple of nits.
| (:user:`benjeffery`, :pr:`3153`) | ||
|
|
||
| - Implement thin space separation for thousands in the numbers output for html | ||
| and text. |
|
Great, squash and we can merge. |
4d606c5 to
90a4746
Compare
Head branch was pushed to by a user without write access
90a4746 to
aceb8df
Compare
aceb8df to
9f4f8b6
Compare
…t to separate 1000s with a thin space
9f4f8b6 to
b9fa6c0
Compare


Implemented a format_number method in util that accepts a string or a number and returns the number separated by a thin space. Used the format_number for the string representation and the html output of trees, treesequence, and variants
Fixes #2951