-
Notifications
You must be signed in to change notification settings - Fork 77
Improve string and html output #1300
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
Conversation
Codecov Report
@@ Coverage Diff @@
## main #1300 +/- ##
==========================================
- Coverage 93.81% 93.80% -0.02%
==========================================
Files 26 26
Lines 22179 22143 -36
Branches 1006 1013 +7
==========================================
- Hits 20808 20772 -36
Misses 1338 1338
Partials 33 33
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
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, very nice!
I'm not sure about tskit.MAX_ROWs, though. ALL_CAPS to me says "constant". What if we followed the say numpy does it and add a set_print_options
function or something?
1cd8c2e
to
2ac70d1
Compare
I've added |
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.
Do you think we could pick this one up and get it merged please @benjeffery? I'd like to use it in a presentation
python/tests/test_tables.py
Outdated
input_data = self.make_input_data(41) | ||
table = self.table_class() | ||
table.set_columns(**input_data) | ||
print(table) |
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.
stray print
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.
Opps, fixed.
f5f0cbd
to
ed75927
Compare
Fixes #1270 by making
__str__
for tables output unicode tables.Introduces
tskit.MAX_LINES
which controls the number of lines to truncate the table to, in this way a user can see the whole of a table by setting it toNone
Also displays decoded metadata instead of base64 encoding it, which also applies to HTML output. Metadata is truncated, to try to keep tables ~80 chars width. This is not controllable.
OLD:

NEW:
