From 5ea6a3c433907fdf26496dae55a912898c67668d Mon Sep 17 00:00:00 2001 From: Rob Zinkov Date: Thu, 3 Nov 2022 18:57:57 +0100 Subject: [PATCH] Add None for fields not used by beanmachine converter --- arviz/data/io_beanmachine.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/arviz/data/io_beanmachine.py b/arviz/data/io_beanmachine.py index 5247b1e869..c5516ac1f3 100644 --- a/arviz/data/io_beanmachine.py +++ b/arviz/data/io_beanmachine.py @@ -24,15 +24,23 @@ def __init__( if "posterior" in self.sampler.namespaces: self.posterior = self.sampler.namespaces["posterior"].samples + else: + self.posterior = None if "posterior_predictive" in self.sampler.namespaces: self.posterior_predictive = self.sampler.namespaces["posterior_predictive"].samples + else: + self.posterior_predictive = None if self.sampler.log_likelihoods is not None: self.log_likelihoods = self.sampler.log_likelihoods + else: + self.log_likelihoods = None if self.sampler.observations is not None: self.observations = self.sampler.observations + else: + self.observations = None @requires("posterior") def posterior_to_xarray(self):