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(
13031303 )
13041304 while proc .poll () is None :
13051305 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 )
13141313 if show_progress and progress_hook is not None :
13151314 progress_hook ("Done" )
13161315
Original file line number Diff line number Diff line change @@ -961,12 +961,11 @@ def do_command(
961961 )
962962 while proc .poll () is None :
963963 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 ())
970969
971970 stdout , _ = proc .communicate ()
972971 if stdout :
Original file line number Diff line number Diff line change 308308 "metadata" : {},
309309 "outputs" : [],
310310 "source" : [
311- " %matplotlib inline\n " ,
312- " import pandas as pd\n " ,
313- " \n " ,
314311 " vars = fit.stan_variables()\n " ,
315312 " 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)"
320314 ]
321315 },
322316 {
You can’t perform that action at this time.
0 commit comments