Saving inference data to netcdf when using nutpie

I have a model that works fine and saves to a netcdf file fine when using the default nuts sampler. However, when using nutpie I cannot save a netcdf file. What I get is TypeError stemming from the sample_stats attribute.

Invalid value for attr ‘sample_stats’: {‘inference_library’: …ect

I tried removing the attribute via delattr but the same error occurs again when try to_netcdf afterwards. Help would be wonderful.

I have reproduced this on a second computer in a fresh conda env. A workaround is pymc 6.0, but it would be nice to fix on v5.

late v5 is a bit of a dependency tangle, what are your pymc arviz xarray and nutpie versions? Also @OriolAbril and @aloctavodia because this might be more of an arviz thing than pymc

pymc 5.28.4

arviz 0.23.4

nutpie 0.16.10

xarray 2026.4.0