-
Notifications
You must be signed in to change notification settings - Fork 77
fix #2951 Use a thin space to indicate groups of 1000s in html/cli print out #3167
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
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.61% 86.76% -2.86%
==========================================
Files 28 11 -17
Lines 31939 24427 -7512
Branches 5866 4615 -1251
==========================================
- Hits 28622 21193 -7429
+ Misses 1886 1853 -33
+ Partials 1431 1381 -50
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just needs a fix for the tests. (I added a "fixes" tag to the PR description as it auto-closes the issue on merge)
python/tskit/genotypes.py
Outdated
f"{util.format_number(counts[k])} ({ | ||
util.format_number(freqs[k] * 100, 2)}%)", | ||
] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This split is causing the module to fail to import.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good - a couple of nits.
python/CHANGELOG.rst
Outdated
@@ -12,12 +12,15 @@ | |||
associated with each individual as a numpy array. | |||
(:user:`benjeffery`, :pr:`3153`) | |||
|
|||
- Implement thin space separation for thousands in the numbers output for html | |||
and text. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just HTML now.
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
…t to separate 1000s with a thin space
aceb8df
to
9f4f8b6
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