#NEWLINE# @ pytest . mark . skipif ( 'YT_VERSION is None or YT_VERSION < 3' ) #NEWLINE# def test_from_yt( tmpdir ) : #NEWLINE# #INDENT# from yt import load #NEWLINE# ds = load ( os . path . join ( DATA , 'DD0010' , 'moving7_0010' ) ) #NEWLINE# def _dust_density( field , data ) : #NEWLINE# #INDENT# return ( data [ 'density' ] . in_units ( 'g/cm**3' ) * 0.01 ) #NEWLINE# #UNINDENT# ds . add_field ( ( 'gas' , 'dust_density' ) , function = _dust_density , units = 'g/cm**3' ) #NEWLINE# amr = AMRGrid . from_yt ( ds , quantity_mapping = { #NEWLINE# #INDENT# 'density' : ( 'gas' , 'dust_density' ) , #NEWLINE# #UNINDENT# } ) #NEWLINE# m = Model ( ) #NEWLINE# m . set_amr_grid ( amr ) #NEWLINE# m . add_density_grid ( amr [ 'density' ] , get_realistic_test_dust ( ) ) #NEWLINE# s = m . add_point_source ( ) #NEWLINE# s . luminosity = 1000 #NEWLINE# s . temperature = 1000 #NEWLINE# m . set_n_initial_iterations ( 3 ) #NEWLINE# m . set_n_photons ( initial = 100000.0 , imaging = 0 ) #NEWLINE# m . set_propagation_check_frequency ( 1 ) #NEWLINE# m . set_copy_input ( False ) #NEWLINE# input_file = tmpdir . join ( 'test.rtin' ) . strpath #NEWLINE# output_file = tmpdir . join ( 'test.rtout' ) . strpath #NEWLINE# m . write ( input_file ) #NEWLINE# m . run ( output_file )