Skip to content

Commit

Permalink
fix: Use deepcopy for data in build function (#61)
Browse files Browse the repository at this point in the history
  • Loading branch information
ahartikainen authored and riddell-stan committed Dec 30, 2018
1 parent 2d5932d commit 733de3e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions stan/model.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import collections.abc
from copy import deepcopy
import json
import time
import typing
Expand Down Expand Up @@ -198,6 +199,8 @@ def build(program_code, data=None, random_seed=None):
"""
if data is None:
data = {}
else:
data = deepcopy(data)
data = _ensure_json_serializable(data)
with stan.common.httpstan_server() as server:
host, port = server.host, server.port
Expand Down

0 comments on commit 733de3e

Please sign in to comment.