Skip to content

Commit

Permalink
Merge branch 'v2.0.0' of https://github.com/MREYE-LUMC/ZOSPy into lvv…
Browse files Browse the repository at this point in the history
…/v2.0.0/systemviewers
  • Loading branch information
LucVV committed Dec 18, 2024
2 parents bec5a22 + 0e78d2e commit 0ca1715
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ruff_defaults.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ select = [
"ARG004",
"ARG005",
"ASYNC100",
"ASYNC101",
"ASYNC102",
"B002",
"B003",
"B004",
Expand Down
10 changes: 10 additions & 0 deletions zospy/analyses/new/surface/curvature.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

from __future__ import annotations

import logging
import re
from typing import Annotated

Expand Down Expand Up @@ -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}")

Expand Down

0 comments on commit 0ca1715

Please sign in to comment.