Skip to content

Conversation

gragusa
Copy link

@gragusa gragusa commented Oct 15, 2025

MCMCChains currently targets the PrettyTables.jl 2.x API. This PR adds compatibility with PrettyTables.jl 3.x while preserving the existing 2.x behavior. Downstream packages that still depend on PrettyTables 2.x will continue to work, and environments that can upgrade to 3.x will automatically use the new API.

@gragusa
Copy link
Author

gragusa commented Oct 15, 2025

Just realized that PR #431 makes this obsolete. But #431 is a breaking change, while this PR is not breaking and could be merged.

@penelopeysm penelopeysm self-requested a review October 20, 2025 00:31
@penelopeysm
Copy link
Member

penelopeysm commented Oct 20, 2025

Hi @gragusa thanks for this PR! This is very helpful.

Could I ask you to add a test for this please? I think the most sensible place is in test/display_tests.jl. The method you modified targets ChainDataFrame, so I think just making one of those (e.g. via mean(chain)) and testing that display(...) doesn't error should be fine.

formatters = formatter,
tf = isdefined(PrettyTables, :borderless) ? PrettyTables.borderless : PrettyTables.tf_borderless,
)
if pkgversion(PrettyTables) < v"3.0"
Copy link
Member

@penelopeysm penelopeysm Oct 20, 2025

Choose a reason for hiding this comment

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

Suggested change
if pkgversion(PrettyTables) < v"3.0"
@static if pkgversion(PrettyTables) < v"3.0"

I'm not sure it really makes a difference, but it probably can't hurt.

Copy link
Member

Choose a reason for hiding this comment

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

pkgversion is not supported on Julia < 1.9. IMO the easiest (for the compiler and for maintenance) would be to just require PrettyTables 3 and not introduce any code that is conditional on the loaded PrettyTables version.

Copy link

codecov bot commented Oct 20, 2025

Codecov Report

❌ Patch coverage is 57.14286% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 87.98%. Comparing base (7f54270) to head (d014596).

Files with missing lines Patch % Lines
src/summarize.jl 57.14% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #498      +/-   ##
==========================================
- Coverage   88.33%   87.98%   -0.35%     
==========================================
  Files          20       20              
  Lines        1354     1315      -39     
==========================================
- Hits         1196     1157      -39     
  Misses        158      158              

☔ 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.

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.

3 participants