From 75f6a80daaa37a801782e6986e1e193f0c716b39 Mon Sep 17 00:00:00 2001 From: Tammo van der Heide Date: Fri, 22 Nov 2024 10:45:49 +0100 Subject: [PATCH] Fix SK-parser bug --- sktools/src/sktools/common.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/sktools/src/sktools/common.py b/sktools/src/sktools/common.py index 15610dae..bd75cc0f 100644 --- a/sktools/src/sktools/common.py +++ b/sktools/src/sktools/common.py @@ -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):