-
Notifications
You must be signed in to change notification settings - Fork 48
Fix show definitions
#466
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
Fix show definitions
#466
Conversation
|
AdvancedHMC.jl documentation for PR #466 is available at: |
Codecov Report❌ Patch coverage is
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. 🚀 New features to boost your workflow:
|
sunxd3
left a comment
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
Co-authored-by: Xianda Sun <[email protected]>
Fixes #459.
With this PR, the example just prints
and does not show all diagonal entries anymore.
The problem with #446 is that it replaced the
show(io, x)definitions withshow(io, ::MIME"text/plain", x)definitions, instead of only defining the 3-argumentshowmethods when appropriate.This change implies that the 2-argument
showmethod 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
showmethod 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-argumentshowmethod as well; where the 3-argumentshowmethod 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 ofDiagEuclideanMetricshown above).