How to change `max_treedepth` in `pystan.model.sampling`?

I am new to STAN, mainly using pystan. I simply cannot change max_treedepth in sampling. The following codes do not work due to syntax error!

fit = sm.sampling(data=data, iter=2000, chains=4, warmup=400, thin=3, seed=187201,control=max_treedepth(15))
fit = sm.sampling(data=data, iter=2000, chains=4, warmup=400, thin=3, seed=187201,control=list(max_treedepth=15))

The documentations are not up to the mark, I am sorry to say this. Please help.
Thanks in advance.

Use dict instead of list (this is Python, not R)

fit = sm.sampling(data=data, iter=2000, chains=4,
                  warmup=400, thin=3, seed=187201,
                  control=dict(max_treedepth=15))
2 Likes