Skip to content

Commit

Permalink
Fix: Ignore empty lines in datfile
Browse files Browse the repository at this point in the history
  • Loading branch information
op3 committed Feb 23, 2024
1 parent ed299da commit 44c7e54
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/boris/boris2spec_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import argparse
from pathlib import Path

import numpy as np
import math


def boris2spec_app():
Expand Down Expand Up @@ -115,7 +115,7 @@ def boris2spec_app():
"--hdi-prob",
metavar="PROB",
help="HDI prob for which interval will be computed",
default=np.math.erf(np.sqrt(0.5)),
default=math.erf(math.sqrt(0.5)),
)
parser.add_argument(
"--burn",
Expand Down
3 changes: 2 additions & 1 deletion src/boris/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,8 @@ def read_dat_file(dat_file_path: Path, sim_root: Path | None = None) -> list[Sim
sim_root = sim_root or dat_file_path.parents[0]
with open(dat_file_path) as f:
for line in f:
simulations.append(SimInfo.from_dat_file_line(line, sim_root))
if line.strip():
simulations.append(SimInfo.from_dat_file_line(line, sim_root))
return simulations


Expand Down

0 comments on commit 44c7e54

Please sign in to comment.