File tree Expand file tree Collapse file tree 1 file changed +19
-8
lines changed
src/ansys/dpf/core/documentation Expand file tree Collapse file tree 1 file changed +19
-8
lines changed Original file line number Diff line number Diff line change 2727import os
2828from pathlib import Path
2929import re
30+ import warnings
3031
3132from ansys .dpf import core as dpf
3233from ansys .dpf .core .changelog import Changelog
@@ -90,17 +91,27 @@ def initialize_server(
9091 binary_name = "composite_operators.dll"
9192 else :
9293 binary_name = "libcomposite_operators.so"
93- load_library (
94- filename = Path (server .ansys_path ) / "dpf" / "plugins" / "dpf_composites" / binary_name ,
95- name = "composites" ,
96- )
94+ try :
95+ load_library (
96+ filename = Path (server .ansys_path )
97+ / "dpf"
98+ / "plugins"
99+ / "dpf_composites"
100+ / binary_name ,
101+ name = "composites" ,
102+ )
103+ except Exception as e :
104+ warnings .warn ("Could not load Composites plugin:" f"{ e } " )
97105 if include_sound and server .os == "nt" : # pragma: nocover
98106 if verbose :
99107 print ("Loading Acoustics Plugin" )
100- load_library (
101- filename = Path (server .ansys_path ) / "Acoustics" / "SAS" / "ads" / "dpf_sound.dll" ,
102- name = "sound" ,
103- )
108+ try :
109+ load_library (
110+ filename = Path (server .ansys_path ) / "Acoustics" / "SAS" / "ads" / "dpf_sound.dll" ,
111+ name = "sound" ,
112+ )
113+ except Exception as e :
114+ warnings .warn ("Could not load Acoustics plugin:" f"{ e } " )
104115 if verbose : # pragma: nocover
105116 print (f"Loaded plugins: { list (server .plugins .keys ())} " )
106117 return server
You can’t perform that action at this time.
0 commit comments