Skip to content

Commit

Permalink
fix pystan3 empty arrays (#1584)
Browse files Browse the repository at this point in the history
  • Loading branch information
ahartikainen authored Mar 5, 2021
1 parent f86ddec commit c4005b1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions arviz/data/io_pystan.py
Original file line number Diff line number Diff line change
Expand Up @@ -781,6 +781,8 @@ def get_draws_stan3(fit, model=None, variables=None, ignore=None):

# in future fix the correct number of draws if fit.save_warmup is True
new_shape = (*fit.dims[fit.param_names.index(var)], -1, fit.num_chains)
if 0 in new_shape:
continue
values = fit._draws[fit._parameter_indexes(var), :] # pylint: disable=protected-access
values = values.reshape(new_shape, order="F")
values = np.moveaxis(values, [-2, -1], [1, 0])
Expand Down

0 comments on commit c4005b1

Please sign in to comment.