Skip to content

Conversation

@devmotion
Copy link
Member

Fixes #459.

With this PR, the example just prints

DiagEuclideanMetric([0.992486, 0.866971, 1.1456 ...]): mass_matrix

and does not show all diagonal entries anymore.


The problem with #446 is that it replaced the show(io, x) definitions with show(io, ::MIME"text/plain", x) definitions, instead of only defining the 3-argument show methods when appropriate.
This change implies that the 2-argument show method currently uses the fallback of printing the full type information + all fields, which causes these enormous diagonal and dense metrics to be fully displayed.
In this PR, in all cases where the 3-argument show method was defined to print a single line I removed the ::MIME"text/plain" argument since in principle such compact output is appropriate for the 2-argument show method as well; where the 3-argument show method was defined to print multiple lines, I added a 2-argument version that only prints a single line (showing a constructor of the type, sometimes with shortened arguments as in the case of DiagEuclideanMetric shown above).

@github-actions
Copy link
Contributor

github-actions bot commented Sep 8, 2025

AdvancedHMC.jl documentation for PR #466 is available at:
https://TuringLang.github.io/AdvancedHMC.jl/previews/PR466/

@devmotion devmotion mentioned this pull request Sep 8, 2025
@codecov
Copy link

codecov bot commented Sep 9, 2025

Codecov Report

❌ Patch coverage is 80.76923% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 77.66%. Comparing base (2f5b6c1) to head (99466d8).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
src/adaptation/stepsize.jl 50.00% 2 Missing ⚠️
src/trajectory.jl 33.33% 2 Missing ⚠️
src/adaptation/stan_adaptor.jl 66.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #466      +/-   ##
==========================================
+ Coverage   75.44%   77.66%   +2.21%     
==========================================
  Files          21       21              
  Lines        1230     1240      +10     
==========================================
+ Hits          928      963      +35     
+ Misses        302      277      -25     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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

@yebai yebai requested a review from sunxd3 September 10, 2025 10:52
sunxd3
sunxd3 previously approved these changes Sep 10, 2025
Copy link
Member

@sunxd3 sunxd3 left a comment

Choose a reason for hiding this comment

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

LGTM

Co-authored-by: Xianda Sun <[email protected]>
@devmotion devmotion enabled auto-merge (squash) September 11, 2025 09:11
@devmotion devmotion disabled auto-merge September 11, 2025 09:11
@devmotion devmotion merged commit 85adcbd into main Sep 11, 2025
20 checks passed
@devmotion devmotion deleted the dw/io branch September 11, 2025 09:13
@devmotion devmotion mentioned this pull request Sep 11, 2025
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.

Progress bar Metric printing spams the terminal for large models

3 participants