@@ -484,7 +484,7 @@ cdef class StanFit4Model:
484
484
485
485
# public methods
486
486
487
- def plot (self , pars = None , dtypes = {} ):
487
+ def plot (self , pars = None , dtypes = None ):
488
488
""" Visualize samples from posterior distributions
489
489
490
490
Parameters
@@ -508,7 +508,7 @@ cdef class StanFit4Model:
508
508
pars = pystan.misc._remove_empty_pars(pars, self .sim[' pars_oi' ], self .sim[' dims_oi' ])
509
509
return pystan.plots.traceplot(self , pars, dtypes)
510
510
511
- def traceplot (self , pars = None , dtypes = {} ):
511
+ def traceplot (self , pars = None , dtypes = None ):
512
512
""" Visualize samples from posterior distributions
513
513
514
514
Parameters
@@ -524,7 +524,7 @@ cdef class StanFit4Model:
524
524
# FIXME: for now plot and traceplot do the same thing
525
525
return self .plot(pars, dtypes = dtypes)
526
526
527
- def extract (self , pars = None , permuted = True , inc_warmup = False , dtypes = {} ):
527
+ def extract (self , pars = None , permuted = True , inc_warmup = False , dtypes = None ):
528
528
""" Extract samples in different forms for different parameters.
529
529
530
530
Parameters
@@ -558,12 +558,16 @@ cdef class StanFit4Model:
558
558
self ._verify_has_samples()
559
559
if inc_warmup is True and permuted is True :
560
560
logging.warn(" `inc_warmup` ignored when `permuted` is True." )
561
+ if dtypes is None and permuted is False :
562
+ logging.warn(" `dtypes` ignored when `permuted` is False." )
561
563
562
564
if pars is None :
563
565
pars = self .sim[' pars_oi' ]
564
566
elif isinstance (pars, string_types):
565
567
pars = [pars]
566
568
pars = pystan.misc._remove_empty_pars(pars, self .sim[' pars_oi' ], self .sim[' dims_oi' ])
569
+ if dtypes is None :
570
+ dtypes = {}
567
571
568
572
allpars = self .sim[' pars_oi' ] + self .sim[' fnames_oi' ]
569
573
pystan.misc._check_pars(allpars, pars)
0 commit comments