Skip to content

Commit

Permalink
fix: Make sure arguments are JSON-encodable
Browse files Browse the repository at this point in the history
  • Loading branch information
smoh authored and riddell-stan committed Apr 2, 2021
1 parent e2eb998 commit e1e3146
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions stan/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ def _create_fit(self, payload: dict) -> stan.fit.Fit:
assert "random_seed" not in payload, "`random_seed` is set in `build`."
assert "function" in payload

payload = json.loads(DataJSONEncoder().encode(payload))
num_chains = payload.pop("num_chains", 4)

init = payload.pop("init", [dict() for _ in range(num_chains)])
Expand Down

0 comments on commit e1e3146

Please sign in to comment.