Skip to content

Commit e001b5d

Browse files
committed
Change replace_fortran_scientific_notation from class method to static method
1 parent 093e8a4 commit e001b5d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

hydrolib/core/utils.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -343,14 +343,14 @@ class FortranUtils:
343343
r"([\d.]+)([dD])([+-]?\d{1,3})"
344344
) # matches a float: 1d9, 1D-3, 1.D+4, etc.
345345

346-
@classmethod
347-
def replace_fortran_scientific_notation(cls, value):
346+
@staticmethod
347+
def replace_fortran_scientific_notation(value):
348348
"""Replace Fortran scientific notation ("D" in exponent) with standard
349349
scientific notation ("e" in exponent).
350350
"""
351351
if isinstance(value, str):
352-
return cls._scientific_exp_d_notation_regex.sub(r"\1e\3", value)
352+
return FortranUtils._scientific_exp_d_notation_regex.sub(r"\1e\3", value)
353353
elif isinstance(value, list):
354-
return list(map(cls.replace_fortran_scientific_notation, value))
354+
return list(map(FortranUtils.replace_fortran_scientific_notation, value))
355355

356356
return value

0 commit comments

Comments
 (0)