Skip to content

Commit

Permalink
Fix SK-parser bug
Browse files Browse the repository at this point in the history
  • Loading branch information
vanderhe committed Dec 4, 2024
1 parent 40a9137 commit 75f6a80
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions sktools/src/sktools/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,19 +123,18 @@ def writefloats(fp, nums, indent=0, indentstr=None, numperline=4,
PAT_FORTRAN_SEPARATOR = re.compile(r'[,]?\s+')


def split_fortran_fields(sep, maxsplit=0):
def split_fortran_fields(line, maxsplit=0):
''''Splits a line containing Fortran (numeric) fields.
Args:
sep (str): separator to use when splitting the string
line (str): Fortran style content to split
maxsplit (int): maximum number of splits allowed
'''

return [field for field in
PAT_FORTRAN_SEPARATOR.split(sep, maxsplit=maxsplit)
if len(field) > 1]
PAT_FORTRAN_SEPARATOR.split(line, maxsplit=maxsplit) if field]


def convert_fortran_floats(txt):
Expand Down

0 comments on commit 75f6a80

Please sign in to comment.