Drop divergence_message in drop_warning_stat#8334
Conversation
nutpie emits a string-valued divergence_message variable in sample_stats. The drop_warning_stat filter only removed warning and sampler_N__warning variables, so divergence_message survived into idata.sample_stats and made idata.to_netcdf() fail on the object-dtype array. Include divergence_message in the set of dropped names, scoped to sample-stats groups as before. Closes pymc-devs#8321
Documentation build overview
58 files changed ·
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8334 +/- ##
===========================================
+ Coverage 79.80% 91.70% +11.90%
===========================================
Files 125 125
Lines 20526 20526
===========================================
+ Hits 16380 18824 +2444
+ Misses 4146 1702 -2444
🚀 New features to boost your workflow:
|
|
CI triage note: the current red job looks unrelated to this The failing matrix is The |
Description
nutpiecan add a string-valueddivergence_messagevariable tosample_stats, which keepskeep_warning_stat=Falsefrom producing anInferenceDataobject that can be serialized cleanly.This updates
drop_warning_stat()to dropdivergence_messagealongside the existing warning stats, while preserving ordinary sampler stats likediverging. A regression test covers bothsample_statsandwarmup_sample_stats.AI assistance was used under my direction.
Related Issue
Checklist
Type of change
Local checks
uv run --with-editable . --with pytest python -m pytest tests/test_util.py::test_drop_warning_stat tests/test_util.py::test_drop_divergence_message_stat -quv run --with ruff ruff check pymc/util.py tests/test_util.pyuv run --with ruff ruff format --check pymc/util.py tests/test_util.pygit diff --check origin/main...HEAD