Skip to content

Conversation

@pfackeldey
Copy link
Collaborator

Closes #3705.

The type string in .show and _repr_mimebundle_ (notebook repr) now respects the limit_cols arguments:

import awkward as ak
arr = ak.with_parameter([1,2], "systematics", ["some_name"]*500)

arr.show(all=True)
# type: 2 * int64[parameters={"systematics": ["some_name", "some_name", "some_n...
# nbytes: 16 B
# backend: cpu
# [1,
#  2]

and for notebooks:

print(arr._repr_mimebundle_()['text/html'])
# <pre>[1,
#  2]
# ---
# backend: cpu
# nbytes: 16 B
# type: 2 * int64[parameters={&quot;systematics&quot;: [&quot;some_name&quot;, &quot;some_name&quot;, &quot;some_n...</pre>

which renders to:

[1,
 2]
---
backend: cpu
nbytes: 16 B
type: 2 * int64[parameters={"systematics": ["some_name", "some_name", "some_n...

I fixed the same also for named_axis, in this PR.

@codecov
Copy link

codecov bot commented Nov 5, 2025

Codecov Report

❌ Patch coverage is 16.66667% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 82.71%. Comparing base (b749e49) to head (6881712).
⚠️ Report is 466 commits behind head on main.

Files with missing lines Patch % Lines
src/awkward/prettyprint.py 25.00% 3 Missing ⚠️
src/awkward/highlevel.py 0.00% 2 Missing ⚠️
Additional details and impacted files
Files with missing lines Coverage Δ
src/awkward/highlevel.py 78.25% <0.00%> (+1.57%) ⬆️
src/awkward/prettyprint.py 84.13% <25.00%> (ø)

... and 198 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-actions
Copy link

github-actions bot commented Nov 5, 2025

The documentation preview is ready to be viewed at http://preview.awkward-array.org.s3-website.us-east-1.amazonaws.com/PR3712

@pfackeldey pfackeldey requested a review from ianna November 5, 2025 12:12
@ikrommyd
Copy link
Collaborator

ikrommyd commented Nov 5, 2025

@pfackeldey I didn't full understand from the PR description, is the cropping now exactly identical in jupyter notebooks to the cropping you did some time ago for repr?

@pfackeldey
Copy link
Collaborator Author

@pfackeldey I didn't full understand from the PR description, is the cropping now exactly identical in jupyter notebooks to the cropping you did some time ago for repr?

It's not the same, both crop for a max width, but that is different because in the repr we have things like "<Array ..." in addition before the typestring. .show and _repr_mimebundle_ does not (and they should be the same).
The cropping is respecting the full width of what's available.

@ikrommyd
Copy link
Collaborator

ikrommyd commented Nov 5, 2025

@pfackeldey I didn't full understand from the PR description, is the cropping now exactly identical in jupyter notebooks to the cropping you did some time ago for repr?

It's not the same, both crop for a max width, but that is different because in the repr we have things like "<Array ..." in addition before the typestring. .show and _repr_mimebundle_ does not (and they should be the same). The cropping is respecting the full width of what's available.

Thanks, was just curious if it's not OCD friendly 🤣 But cropping with respect to the width is.

Copy link
Collaborator

@ianna ianna left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pfackeldey - Great! Thanks for fixing it. Please, merge it if you are done with it. Thanks!

@pfackeldey pfackeldey merged commit a11c239 into scikit-hep:main Nov 6, 2025
43 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Limit repr length for parameters

3 participants