File tree Expand file tree Collapse file tree 2 files changed +14
-2
lines changed
Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -441,6 +441,12 @@ def _assemble_draws(self) -> None:
441441 self ._metric [chain , i , :] = [
442442 float (x ) for x in xs
443443 ]
444+ else : # unit_e changed in 2.34 to have an extra line
445+ pos = fd .tell ()
446+ line = fd .readline ().strip ()
447+ if not line .startswith ('#' ):
448+ fd .seek (pos )
449+
444450 # process draws
445451 for i in range (sampling_iter_start , num_draws ):
446452 line = fd .readline ().strip ()
Original file line number Diff line number Diff line change @@ -289,10 +289,16 @@ def scan_hmc_params(
289289 raise ValueError (
290290 'line {}: invalid step size: {}' .format (lineno , step_size )
291291 ) from e
292- if metric == 'unit_e' :
293- return lineno
292+ before_metric = fd .tell ()
294293 line = fd .readline ().strip ()
295294 lineno += 1
295+ if metric == 'unit_e' :
296+ if line .startswith ("# No free parameters" ):
297+ return lineno
298+ else :
299+ fd .seek (before_metric )
300+ return lineno - 1
301+
296302 if not (
297303 (
298304 metric == 'diag_e'
You can’t perform that action at this time.
0 commit comments