Skip to content

Commit b8c8414

Browse files
committed
[ModelicaSystemBase] define parse_om_version() as staticmethod
1 parent 418791b commit b8c8414

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

OMPython/ModelicaSystem.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1026,8 +1026,12 @@ def getOptimizationOptions(
10261026

10271027
raise ModelicaSystemError("Unhandled input for getOptimizationOptions()")
10281028

1029-
def _parse_om_version(self, version: str) -> tuple[int, int, int]:
1030-
match = re.search(r"v?(\d+)\.(\d+)\.(\d+)", version)
1029+
@staticmethod
1030+
def _parse_om_version(version: str) -> tuple[int, int, int]:
1031+
"""
1032+
Evaluate an OMC version string and return a tuple of (epoch, major, minor).
1033+
"""
1034+
match = re.search(pattern=r"v?(\d+)\.(\d+)\.(\d+)", string=version)
10311035
if not match:
10321036
raise ValueError(f"Version not found in: {version}")
10331037
major, minor, patch = map(int, match.groups())

0 commit comments

Comments
 (0)