File tree Expand file tree Collapse file tree 3 files changed +13
-21
lines changed Expand file tree Collapse file tree 3 files changed +13
-21
lines changed Original file line number Diff line number Diff line change @@ -1303,14 +1303,13 @@ def _run_cmdstan(
1303
1303
)
1304
1304
while proc .poll () is None :
1305
1305
if proc .stdout is not None :
1306
- lines = proc .stdout .readlines ()
1307
- for line in lines :
1308
- fd_out .write (line )
1309
- line = line .strip ()
1310
- if show_console and len (line ) > 1 :
1311
- print ('chain {}: {}' .format (idx + 1 , line ))
1312
- if show_progress and progress_hook is not None :
1313
- progress_hook (line )
1306
+ line = proc .stdout .readline ()
1307
+ fd_out .write (line )
1308
+ line = line .strip ()
1309
+ if show_console and len (line ) > 1 :
1310
+ print ('chain {}: {}' .format (idx + 1 , line ))
1311
+ if show_progress and progress_hook is not None :
1312
+ progress_hook (line )
1314
1313
if show_progress and progress_hook is not None :
1315
1314
progress_hook ("Done" )
1316
1315
Original file line number Diff line number Diff line change @@ -961,12 +961,11 @@ def do_command(
961
961
)
962
962
while proc .poll () is None :
963
963
if proc .stdout is not None :
964
- lines = proc .stdout .readlines ()
965
- for line in lines :
966
- if fd_out is not None :
967
- fd_out .write (line )
968
- if pbar is not None :
969
- pbar (line .strip ())
964
+ line = proc .stdout .readline ()
965
+ if fd_out is not None :
966
+ fd_out .write (line )
967
+ if pbar is not None :
968
+ pbar (line .strip ())
970
969
971
970
stdout , _ = proc .communicate ()
972
971
if stdout :
Original file line number Diff line number Diff line change 308
308
"metadata" : {},
309
309
"outputs" : [],
310
310
"source" : [
311
- " %matplotlib inline\n " ,
312
- " import pandas as pd\n " ,
313
- " \n " ,
314
311
" vars = fit.stan_variables()\n " ,
315
312
" for (k,v) in vars.items():\n " ,
316
- " print(k, v.shape)\n " ,
317
- " \n " ,
318
- " thetas = fit.stan_variable(var='theta')\n " ,
319
- " pd.DataFrame(data=thetas).plot.density()"
313
+ " print(k, v.shape)"
320
314
]
321
315
},
322
316
{
You can’t perform that action at this time.
0 commit comments