From a07f8b7c6913880704c0bf7cc9390740e30f5568 Mon Sep 17 00:00:00 2001 From: Steve Doyle Date: Wed, 4 Dec 2024 21:06:31 -0800 Subject: [PATCH] load f06 fix --- pyNastran/f06/gui_flutter.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/pyNastran/f06/gui_flutter.py b/pyNastran/f06/gui_flutter.py index 75dacb694..31bca8e6f 100644 --- a/pyNastran/f06/gui_flutter.py +++ b/pyNastran/f06/gui_flutter.py @@ -1288,8 +1288,8 @@ def _to_str(value: Optional[int | float]) -> str: def load_f06_op2(f06_filename: str, log: SimpleLogger, f06_units: str, - out_units: str) -> list[FlutterResponse]: - responses = [] + out_units: str) -> dict[int, FlutterResponse]: + responses = {} ext = os.path.splitext(f06_filename)[1].lower() if ext == '.f06': try: @@ -1301,7 +1301,12 @@ def load_f06_op2(f06_filename: str, log: SimpleLogger, log.error(str(e)) return responses elif ext == '.op2': - from pyNastran.op2.op2 import OP2 + try: + from pyNastran.op2.op2 import OP2 + except ImportError as e: + log.error(str(e)) + return responses + model = OP2(log=log) results_to_include = ['eigenvectors'] model.set_results(results_to_include)