Skip to content

Commit

Permalink
Add None for fields not used
Browse files Browse the repository at this point in the history
  • Loading branch information
zaxtax committed Nov 3, 2022
1 parent 8c819d2 commit d2604da
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions arviz/data/io_beanmachine.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit d2604da

Please sign in to comment.