Skip to content

Commit

Permalink
try deepcopy again
Browse files Browse the repository at this point in the history
  • Loading branch information
ahartikainen committed Dec 29, 2018
1 parent da0aff3 commit 92b1af3
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion arviz/tests/helpers.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""Test helper functions."""
from collections import OrderedDict
from copy import deepcopy
import os
import pickle
import sys
Expand Down Expand Up @@ -234,7 +235,11 @@ def pystan_noncentered_schools(data, draws, chains):
stan_model = pystan.StanModel(model_code=schools_code)
fit = stan_model.sampling(data=data, iter=draws, warmup=0, chains=chains)
else:
stan_model = pystan.build(schools_code, data=data)
# PyStan3 bug
data_ = {}
for k, v in data.items():
data_[k] = deepcopy(v)
stan_model = pystan.build(schools_code, data=data_)
fit = stan_model.sample(
num_chains=chains, num_samples=draws, num_warmup=0, save_warmup=False
)
Expand Down

0 comments on commit 92b1af3

Please sign in to comment.