Skip to content

Commit 6a46776

Browse files
authored
Merge pull request #209 from pmav99/improve_parse_hgrid
fix: parse_hgrid(): Handle multiple spaces in boundary definition
2 parents 2fcb022 + e0e8892 commit 6a46776

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

pyposeidon/utils/cfl.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99
import numpy as np
1010
import numpy.typing as npt
11-
import pandas as pd
1211
import pymap3d
1312

1413

@@ -60,7 +59,7 @@ def parse_hgrid(
6059
no_nodes_in_boundary = int(parsed[0])
6160
boundary_type = 0
6261
else:
63-
no_nodes_in_boundary, boundary_type = map(int, parsed)
62+
no_nodes_in_boundary, boundary_type = map(int, (p for p in parsed if p))
6463
boundary_nodes = np.genfromtxt(fd, delimiter=sep, usecols=(0,), max_rows=no_nodes_in_boundary, dtype=int)
6564
boundary_nodes -= 1 # 0-based-index
6665
boundaries[boundary_type].append(boundary_nodes)

0 commit comments

Comments
 (0)