4444from pyNastran .f06 .dev .read_sol_200 import plot_sol_200 # read_sol_200
4545from pyNastran .op2 .op2 import OP2
4646from pyNastran .utils import print_bad_path
47-
47+ try :
48+ from pyNastran .f06 .dev .flutter .utils import load_f06_op2 , get_png_filename
49+ IS_DEV = True
50+ except ImportError :
51+ IS_DEV = False
4852
4953DIRNAME = os .path .dirname (__file__ )
5054PKG_PATH = Path (pyNastran .__path__ [0 ])
@@ -214,6 +218,36 @@ def test_plot_flutter_bah(self):
214218 # subcases=[1, 3],
215219 # log=log)
216220
221+ @unittest .skipIf (not IS_DEV , 'no flutter-dev' )
222+ def test_plot_flutter_0012_dev (self ):
223+ """tests load_f06_op2 and get_png_filename"""
224+ log = SimpleLogger (level = 'warning' )
225+ dirname = AERO_PATH / '2_mode_flutter'
226+ f06_filename = dirname / '0012_flutter.f06'
227+ load_f06_op2 (f06_filename , log ,
228+ in_units = 'si' , out_units = 'si' , use_rhoref = False )
229+
230+ base = 'base'
231+ x_plot_type = 'eas'
232+ plot_type = 'Vg'
233+ export_to_png = True
234+ png_filename0 , png_filename = get_png_filename (
235+ base , x_plot_type , plot_type ,
236+ export_to_png )
237+ assert png_filename0 == 'base_Vg.png' , png_filename0
238+ assert png_filename == 'base_Vg.png' , png_filename
239+ png_filename0 , png_filename = get_png_filename (
240+ base , 'x-' + x_plot_type , plot_type ,
241+ export_to_png )
242+ assert png_filename0 == 'base_Vg.png' , png_filename0
243+ assert png_filename == 'base_Vg.png' , png_filename
244+
245+ png_filename0 , png_filename = get_png_filename (
246+ base , 'x-' + x_plot_type , plot_type ,
247+ export_to_png = False )
248+ assert png_filename0 == 'base_Vg.png' , png_filename0
249+ assert png_filename is None , png_filename
250+
217251 def test_plot_flutter_0012 (self ):
218252 """
219253 tests plot_flutter_f06
@@ -222,6 +256,7 @@ def test_plot_flutter_0012(self):
222256 """
223257 dirname = AERO_PATH / '2_mode_flutter'
224258 f06_filename = dirname / '0012_flutter.f06'
259+
225260 #log = get_logger(log=None, level=None, encoding='utf-8')
226261 log = get_logger (log = None , level = False , encoding = 'utf-8' )
227262
0 commit comments