Skip to content

Conversation

@trulsf
Copy link
Member

@trulsf trulsf commented Sep 30, 2025

Working with some large models, I get overwhelmed by the printing of large profiles. My suggestion is to have some customized printing that just prints the first and last values in line with other Julia printing. This is a rough first version and just shows what I was thinking as a possible solution.

@trulsf trulsf requested review from JulStraus and hellemo September 30, 2025 20:29
Copy link
Collaborator

@JulStraus JulStraus left a comment

Choose a reason for hiding this comment

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

I generally like the idea and it seems to work out well. While we miss a bit of information in the show statement compared to the current design (the specific type), I think it is still beneficial to operate it this way.

Your rough solution works out rather well in my opinion :)

src/profiles.jl Outdated
nshow = round(Int, max_elems / 2)
seq1 = vals[1:nshow]
seq2 = vals[(end-nshow+1):end]
return join(seq1, sep) * sep * "... " * sep * join(seq2, sep)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
return join(seq1, sep) * sep * "... " * sep * join(seq2, sep)
return join(seq1, sep) * sep * "..." * sep * join(seq2, sep)

I think it looks better without spaces before ....

Copy link
Collaborator

Choose a reason for hiding this comment

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

You removed the comma in general? It is more in line with how Julia represents the values, so I think it is ok.

@trulsf
Copy link
Member Author

trulsf commented Oct 1, 2025

I have updated and tweaked the printing a bit based on ideas from Julian (indenting) and tried to align with what looks to be Julia standard (vector, matrices).

@JulStraus
Copy link
Collaborator

I like the new changes. We can however consider to have in the _profile_name function as well the length and start the values on the new line? This would be in line with the standard functionality.

Note that with eltype S is not used when vectors or matrices are shown. This is only used if a function modifies them (e.g., adjoint or transpose. It seems to me that Julia in this case not consistent with itself.

@codecov-commenter
Copy link

codecov-commenter commented Oct 4, 2025

Codecov Report

❌ Patch coverage is 0% with 46 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/profiles.jl 0.00% 46 Missing ⚠️
Files with missing lines Coverage Δ
src/profiles.jl 60.21% <0.00%> (-18.84%) ⬇️

... and 5 files with indirect coverage changes

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

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.

4 participants