We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
print_truncated() does not handle other list-like objects (e.g. numpy arrays), making for messy outputs for __repr__().
print_truncated()
__repr__()
BiocUtils/src/biocutils/print_truncated.py
Lines 26 to 29 in e4d9f8b
When executing in a jupyter notebook, the output is not truncated:
import numpy as np from biocframe import BiocFrame bframe = BiocFrame( { "x": np.random.normal(size=40), "y": np.random.normal(size=40) } ) bframe >> BiocFrame(data={'x': array([ 0.30948609, -1.38289079, -0.43285149, 0.37465808, 0.47068355, 0.72958816, -1.99939489, 0.22849544, -0.15900403, 0.1183286 , -0.12025139, -0.31011542, 0.2261699 , -1.23073433, -0.98790469, 0.37100134, 1.11801526, 1.89313668, -0.72167481, 1.21427698]), 'y': array([-0.96331348, 0.90240032, 0.45289567, 0.74154537, 0.09252068, -0.30991981, 0.81609081, -0.21092948, 0.17191497, 0.01036059, 0.21667765, -0.35905261, -0.53184703, -0.64036229, 0.25275972, -0.31644878, -0.57082027, -0.39594529, 2.26653958, -0.31656108])}, number_of_rows=20, column_names=['x', 'y'])
As a start,
elif isinstance(x, (list, np.ndarray)): return print_truncated_list( list(x), truncated_to=truncated_to, full_threshold=full_threshold )
Should we handle other list-like objects?
The text was updated successfully, but these errors were encountered:
No branches or pull requests
print_truncated()
does not handle other list-like objects (e.g. numpy arrays), making for messy outputs for__repr__()
.BiocUtils/src/biocutils/print_truncated.py
Lines 26 to 29 in e4d9f8b
Current behavior
When executing in a jupyter notebook, the output is not truncated:
Proposed solution
As a start,
Question
Should we handle other list-like objects?
The text was updated successfully, but these errors were encountered: