diff --git a/ruff_defaults.toml b/ruff_defaults.toml index 24088ce..b0087db 100644 --- a/ruff_defaults.toml +++ b/ruff_defaults.toml @@ -15,6 +15,8 @@ select = [ "ARG004", "ARG005", "ASYNC100", + "ASYNC101", + "ASYNC102", "B002", "B003", "B004", diff --git a/zospy/analyses/new/surface/curvature.py b/zospy/analyses/new/surface/curvature.py index 93e8c11..499de2d 100644 --- a/zospy/analyses/new/surface/curvature.py +++ b/zospy/analyses/new/surface/curvature.py @@ -2,6 +2,7 @@ from __future__ import annotations +import logging import re from typing import Annotated @@ -148,6 +149,15 @@ def get_data_grid(self) -> CurvatureResult | None: datagrid = self.analysis.Results.GetDataGrid(0) match = curvature_description_regex.match(datagrid.Description) + if match is None: # fall back to using exported text files + logging.warning( + "Could not obtain description parameters from datagrid.Description, trying to use exported text file" + ) + + self._needs_text_output_file = True + self._text_output_file, self._remove_text_output_file = self._create_tempfile(None, ".txt") + match = curvature_description_regex.search(self.get_text_output()) + if match is None: raise ValueError(f"Could not parse description: {datagrid.Description}")