def test_mesh_write(): thisdir = os.path.dirname(__file__) usrbin_file = os.path.join(thisdir, "fluka_usrbin_single.lis") usrbin_object = fluka.Usrbin(usrbin_file) data = usrbin_object.tally['single_n'] data.write_hdf5("test_data.h5m")
def test_mesh_write(): if not HAVE_PYMOAB: raise SkipTest thisdir = os.path.dirname(__file__) usrbin_file = os.path.join(thisdir, "fluka_usrbin_single.lis") usrbin_object = fluka.Usrbin(usrbin_file) data = usrbin_object.tally["single_n"] data.write_hdf5("test_fluka_data.h5m")
def test_single_usrbin(): """Test a usrbin file containing a single tally. """ if not HAVE_PYMOAB: raise SkipTest thisdir = os.path.dirname(__file__) usrbin_file = os.path.join(thisdir, "fluka_usrbin_single.lis") usrbin_object = fluka.Usrbin(usrbin_file) # Test UsrbinTally attributes expected_xbounds = [-3.0, 0.0, 3.0, 6.0] expected_ybounds = [-3.0, -1.0, 1.0, 3.0] expected_zbounds = [-3.0, -2.0, -1.0, 0.0] assert_equal(usrbin_object.tally['single_n'].coord_sys, 'Cartesian') assert_equal(usrbin_object.tally['single_n'].name, 'single_n') assert_equal(usrbin_object.tally['single_n'].particle, '8') assert_equal(usrbin_object.tally['single_n'].x_bounds, expected_xbounds) assert_equal(usrbin_object.tally['single_n'].y_bounds, expected_ybounds) assert_equal(usrbin_object.tally['single_n'].z_bounds, expected_zbounds) # Test error and part data values match expected_part_data = [ 1.0984E-02, 4.1051E-03, 1.0636E-03, 2.1837E-02, 5.5610E-03, 1.9119E-03, 1.0971E-02, 3.3943E-03, 1.2456E-03, 1.6615E-02, 2.9501E-03, 7.4597E-04, 1.0395E-01, 6.1186E-03, 1.4997E-03, 1.7421E-02, 3.0824E-03, 7.3878E-04, 1.8097E-02, 5.2532E-03, 2.1572E-03, 1.0465E-01, 6.2611E-03, 1.8829E-03, 1.7323E-02, 5.5092E-03, 2.1418E-03 ] expected_error_data = [ 5.0179E+00, 1.6521E+01, 1.3973E+01, 4.2025E+00, 8.1766E+00, 1.1465E+01, 7.2005E+00, 1.0479E+01, 1.5640E+01, 5.5994E+00, 1.3275E+01, 2.7617E+01, 7.3788E-01, 6.7200E+00, 1.9092E+01, 7.3670E+00, 1.3018E+01, 2.8866E+01, 5.7221E+00, 1.5916E+01, 2.6001E+01, 8.3490E-01, 1.6715E+01, 1.2759E+01, 5.0763E+00, 1.1420E+01, 1.0040E+01 ] for i, v_e in enumerate( usrbin_object.tally['single_n'].structured_iterate_hex("zyx")): read = usrbin_object.tally['single_n'].part_data_tag[v_e] assert_equal( usrbin_object.tally['single_n'].part_data_tag.name, 'part_data_8') expected = expected_part_data[i] assert_equal(read, expected) for i, v_e in enumerate( usrbin_object.tally['single_n'].structured_iterate_hex("zyx")): read = usrbin_object.tally['single_n'].error_data_tag[v_e] assert_equal( usrbin_object.tally['single_n'].error_data_tag.name, 'error_data_8') expected = expected_error_data[i] assert_equal(read, expected)
def test_degenerate_usrbin(): """Test usrbin file containing tallies with different number of bins in each direction. """ if not HAVE_PYMOAB: raise SkipTest thisdir = os.path.dirname(__file__) usrbin_file = os.path.join(thisdir, "fluka_usrbin_degenerate.lis") usrbin_object = fluka.Usrbin(usrbin_file) # Tally #1: # Test UsrbinTally attributes expected_xbounds = [-3.0, 0.0, 3.0, 6.0] expected_ybounds = [-3.0, 0.0, 3.0] expected_zbounds = [-3.0, 0.0] assert_equal(usrbin_object.tally["degen1"].coord_sys, "Cartesian") assert_equal(usrbin_object.tally["degen1"].name, "degen1") assert_equal(usrbin_object.tally["degen1"].particle, "8") assert_equal(usrbin_object.tally["degen1"].x_bounds, expected_xbounds) assert_equal(usrbin_object.tally["degen1"].y_bounds, expected_ybounds) assert_equal(usrbin_object.tally["degen1"].z_bounds, expected_zbounds) # Test error and part data values match expected_part_data = [ 3.5279e-02, 4.7334e-03, 1.4458e-03, 3.6242e-02, 4.6521e-03, 1.5292e-03, ] expected_error_data = [ 1.2016e00, 6.4313e00, 7.7312e00, 2.0235e00, 9.4199e00, 8.0514e00, ] for i, v_e in enumerate( usrbin_object.tally["degen1"].structured_iterate_hex("zyx")): read = usrbin_object.tally["degen1"].part_data_tag[v_e] assert usrbin_object.tally[ "degen1"].part_data_tag.name == "part_data_8" expected = expected_part_data[i] assert_equal(read, expected) for i, v_e in enumerate( usrbin_object.tally["degen1"].structured_iterate_hex("zyx")): read = usrbin_object.tally["degen1"].error_data_tag[v_e] assert usrbin_object.tally[ "degen1"].error_data_tag.name == "error_data_8" expected = expected_error_data[i] assert_equal(read, expected) # Tally #2: # Test UsrbinTally attributes expected_xbounds = [-3.0, 1.5, 6.0] expected_ybounds = [-3.0, 3.0] expected_zbounds = [-3.0, -2.0, -1.0, 0.0] assert_equal(usrbin_object.tally["degen2"].coord_sys, "Cartesian") assert_equal(usrbin_object.tally["degen2"].name, "degen2") assert_equal(usrbin_object.tally["degen2"].particle, "8") assert_equal(usrbin_object.tally["degen2"].x_bounds, expected_xbounds) assert_equal(usrbin_object.tally["degen2"].y_bounds, expected_ybounds) assert_equal(usrbin_object.tally["degen2"].z_bounds, expected_zbounds) # Test error and part data values match expected_part_data = [ 1.1543e-02, 2.0295e-03, 3.2603e-02, 1.4229e-03, 3.3492e-02, 2.7923e-03, ] expected_error_data = [ 2.7321e00, 5.2342e00, 7.4679e-01, 4.2862e00, 1.3090e00, 1.4151e01, ] for i, v_e in enumerate( usrbin_object.tally["degen2"].structured_iterate_hex("zyx")): read = usrbin_object.tally["degen2"].part_data_tag[v_e] assert usrbin_object.tally[ "degen2"].part_data_tag.name == "part_data_8" expected = expected_part_data[i] assert_equal(read, expected) for i, v_e in enumerate( usrbin_object.tally["degen2"].structured_iterate_hex("zyx")): read = usrbin_object.tally["degen2"].error_data_tag[v_e] assert usrbin_object.tally[ "degen2"].error_data_tag.name == "error_data_8" expected = expected_error_data[i] assert_equal(read, expected) # Tally #3: # Test UsrbinTally attributes expected_xbounds = [-3.0, 6.0] expected_ybounds = [-3.0, -1.0, 1.0, 3.0] expected_zbounds = [-3.0, -1.5, 0.0] assert_equal(usrbin_object.tally["degen3"].coord_sys, "Cartesian") assert_equal(usrbin_object.tally["degen3"].name, "degen3") assert_equal(usrbin_object.tally["degen3"].particle, "8") assert_equal(usrbin_object.tally["degen3"].x_bounds, expected_xbounds) assert_equal(usrbin_object.tally["degen3"].y_bounds, expected_ybounds) assert_equal(usrbin_object.tally["degen3"].z_bounds, expected_zbounds) # Test error and part data values match expected_part_data = [ 5.8037e-03, 1.3260e-02, 5.6046e-03, 7.9677e-03, 4.3111e-02, 8.1349e-03, ] expected_error_data = [ 6.1913e00, 2.3684e00, 4.6124e00, 3.2523e00, 1.3714e00, 4.3161e00, ] for i, v_e in enumerate( usrbin_object.tally["degen3"].structured_iterate_hex("zyx")): read = usrbin_object.tally["degen3"].part_data_tag[v_e] assert usrbin_object.tally[ "degen3"].part_data_tag.name == "part_data_8" expected = expected_part_data[i] assert_equal(read, expected) for i, v_e in enumerate( usrbin_object.tally["degen3"].structured_iterate_hex("zyx")): read = usrbin_object.tally["degen3"].error_data_tag[v_e] assert usrbin_object.tally[ "degen3"].error_data_tag.name == "error_data_8" expected = expected_error_data[i] assert_equal(read, expected)
def test_single_usrbin(): """Test a usrbin file containing a single tally.""" if not HAVE_PYMOAB: raise SkipTest thisdir = os.path.dirname(__file__) usrbin_file = os.path.join(thisdir, "fluka_usrbin_single.lis") usrbin_object = fluka.Usrbin(usrbin_file) # Test UsrbinTally attributes expected_xbounds = [-3.0, 0.0, 3.0, 6.0] expected_ybounds = [-3.0, -1.0, 1.0, 3.0] expected_zbounds = [-3.0, -2.0, -1.0, 0.0] assert_equal(usrbin_object.tally["single_n"].coord_sys, "Cartesian") assert_equal(usrbin_object.tally["single_n"].name, "single_n") assert_equal(usrbin_object.tally["single_n"].particle, "8") assert_equal(usrbin_object.tally["single_n"].x_bounds, expected_xbounds) assert_equal(usrbin_object.tally["single_n"].y_bounds, expected_ybounds) assert_equal(usrbin_object.tally["single_n"].z_bounds, expected_zbounds) # Test error and part data values match expected_part_data = [ 1.0984e-02, 4.1051e-03, 1.0636e-03, 2.1837e-02, 5.5610e-03, 1.9119e-03, 1.0971e-02, 3.3943e-03, 1.2456e-03, 1.6615e-02, 2.9501e-03, 7.4597e-04, 1.0395e-01, 6.1186e-03, 1.4997e-03, 1.7421e-02, 3.0824e-03, 7.3878e-04, 1.8097e-02, 5.2532e-03, 2.1572e-03, 1.0465e-01, 6.2611e-03, 1.8829e-03, 1.7323e-02, 5.5092e-03, 2.1418e-03, ] expected_error_data = [ 5.0179e00, 1.6521e01, 1.3973e01, 4.2025e00, 8.1766e00, 1.1465e01, 7.2005e00, 1.0479e01, 1.5640e01, 5.5994e00, 1.3275e01, 2.7617e01, 7.3788e-01, 6.7200e00, 1.9092e01, 7.3670e00, 1.3018e01, 2.8866e01, 5.7221e00, 1.5916e01, 2.6001e01, 8.3490e-01, 1.6715e01, 1.2759e01, 5.0763e00, 1.1420e01, 1.0040e01, ] for i, v_e in enumerate( usrbin_object.tally["single_n"].structured_iterate_hex("zyx")): read = usrbin_object.tally["single_n"].part_data_tag[v_e] assert_equal(usrbin_object.tally["single_n"].part_data_tag.name, "part_data_8") expected = expected_part_data[i] assert_equal(read, expected) for i, v_e in enumerate( usrbin_object.tally["single_n"].structured_iterate_hex("zyx")): read = usrbin_object.tally["single_n"].error_data_tag[v_e] assert_equal(usrbin_object.tally["single_n"].error_data_tag.name, "error_data_8") expected = expected_error_data[i] assert_equal(read, expected)
def test_multiple_usrbin(): """Test a usrbin file containing multiple (two) tallies.""" if not HAVE_PYMOAB: raise SkipTest thisdir = os.path.dirname(__file__) usrbin_file = os.path.join(thisdir, "fluka_usrbin_multiple.lis") usrbin_object = fluka.Usrbin(usrbin_file) # Tally #1: # Test UsrbinTally attributes expected_xbounds = [-3.0, 0.0, 3.0, 6.0] expected_ybounds = [-3.0, -1.0, 1.0, 3.0] expected_zbounds = [-3.0, -2.0, -1.0, 0.0] assert_equal(usrbin_object.tally["multi_p"].coord_sys, "Cartesian") assert_equal(usrbin_object.tally["multi_p"].name, "multi_p") assert_equal(usrbin_object.tally["multi_p"].particle, "7") assert_equal(usrbin_object.tally["multi_p"].x_bounds, expected_xbounds) assert_equal(usrbin_object.tally["multi_p"].y_bounds, expected_ybounds) assert_equal(usrbin_object.tally["multi_p"].z_bounds, expected_zbounds) # Test error and part data values match expected_part_data = [ 7.5083e-04, 1.7570e-04, 3.3361e-05, 1.1232e-03, 3.4735e-04, 1.5816e-04, 6.2264e-04, 2.3071e-04, 8.3469e-05, 1.6700e-03, 4.1785e-04, 7.6990e-05, 3.3842e-03, 9.2931e-04, 2.4958e-04, 1.0121e-03, 2.7993e-04, 6.1043e-05, 7.7401e-04, 3.2480e-04, 9.3145e-06, 1.4245e-03, 4.3352e-04, 1.7392e-04, 7.3166e-04, 2.4210e-04, 1.4804e-04, ] expected_error_data = [ 2.2149e01, 7.4509e01, 1.0000e02, 2.4621e01, 4.6383e01, 3.3621e01, 2.1616e01, 7.5885e01, 1.0000e02, 2.0067e01, 3.3654e01, 6.1265e01, 1.8407e01, 1.6239e01, 5.2119e01, 1.5791e01, 3.8452e01, 1.0000e02, 7.6577e00, 3.5290e01, 1.0000e02, 8.3702e00, 5.3283e01, 6.2602e01, 1.1655e01, 6.2289e01, 6.7541e01, ] for i, v_e in enumerate( usrbin_object.tally["multi_p"].structured_iterate_hex("zyx")): read = usrbin_object.tally["multi_p"].part_data_tag[v_e] assert_equal(usrbin_object.tally["multi_p"].part_data_tag.name, "part_data_7") expected = expected_part_data[i] assert_equal(read, expected) for i, v_e in enumerate( usrbin_object.tally["multi_p"].structured_iterate_hex("zyx")): read = usrbin_object.tally["multi_p"].error_data_tag[v_e] assert_equal(usrbin_object.tally["multi_p"].error_data_tag.name, "error_data_7") expected = expected_error_data[i] assert_equal(read, expected) # Tally #2: # Test UsrbinTally attributes expected_xbounds = [-3.0, 0.0, 3.0, 6.0] expected_ybounds = [-3.0, -1.0, 1.0, 3.0] expected_zbounds = [-3.0, -2.0, -1.0, 0.0] assert_equal(usrbin_object.tally["multi_n"].coord_sys, "Cartesian") assert_equal(usrbin_object.tally["multi_n"].name, "multi_n") assert_equal(usrbin_object.tally["multi_n"].particle, "8") assert_equal(usrbin_object.tally["multi_n"].x_bounds, expected_xbounds) assert_equal(usrbin_object.tally["multi_n"].y_bounds, expected_ybounds) assert_equal(usrbin_object.tally["multi_n"].z_bounds, expected_zbounds) # Test error and part data values match expected_part_data = [ 1.0984e-02, 4.1051e-03, 1.0636e-03, 2.1837e-02, 5.5610e-03, 1.9119e-03, 1.0971e-02, 3.3943e-03, 1.2456e-03, 1.6615e-02, 2.9501e-03, 7.4597e-04, 1.0395e-01, 6.1186e-03, 1.4997e-03, 1.7421e-02, 3.0824e-03, 7.3878e-04, 1.8097e-02, 5.2532e-03, 2.1572e-03, 1.0465e-01, 6.2611e-03, 1.8829e-03, 1.7323e-02, 5.5092e-03, 2.1418e-03, ] expected_error_data = [ 5.0179e00, 1.6521e01, 1.3973e01, 4.2025e00, 8.1766e00, 1.1465e01, 7.2005e00, 1.0479e01, 1.5640e01, 5.5994e00, 1.3275e01, 2.7617e01, 7.3788e-01, 6.7200e00, 1.9092e01, 7.3670e00, 1.3018e01, 2.8866e01, 5.7221e00, 1.5916e01, 2.6001e01, 8.3490e-01, 1.6715e01, 1.2759e01, 5.0763e00, 1.1420e01, 1.0040e01, ] for i, v_e in enumerate( usrbin_object.tally["multi_n"].structured_iterate_hex("zyx")): read = usrbin_object.tally["multi_n"].part_data_tag[v_e] assert usrbin_object.tally[ "multi_n"].part_data_tag.name == "part_data_8" expected = expected_part_data[i] assert_equal(read, expected) for i, v_e in enumerate( usrbin_object.tally["multi_n"].structured_iterate_hex("zyx")): read = usrbin_object.tally["multi_n"].error_data_tag[v_e] assert usrbin_object.tally[ "multi_n"].error_data_tag.name == "error_data_8" expected = expected_error_data[i] assert_equal(read, expected)
def test_multiple_usrbin(): """Test a usrbin file containing multiple (two) tallies. """ if not HAVE_PYMOAB: raise SkipTest thisdir = os.path.dirname(__file__) usrbin_file = os.path.join(thisdir, "fluka_usrbin_multiple.lis") usrbin_object = fluka.Usrbin(usrbin_file) # Tally #1: # Test UsrbinTally attributes expected_xbounds = [-3.0, 0.0, 3.0, 6.0] expected_ybounds = [-3.0, -1.0, 1.0, 3.0] expected_zbounds = [-3.0, -2.0, -1.0, 0.0] assert_equal(usrbin_object.tally['multi_p'].coord_sys, 'Cartesian') assert_equal(usrbin_object.tally['multi_p'].name, 'multi_p') assert_equal(usrbin_object.tally['multi_p'].particle, '7') assert_equal(usrbin_object.tally['multi_p'].x_bounds, expected_xbounds) assert_equal(usrbin_object.tally['multi_p'].y_bounds, expected_ybounds) assert_equal(usrbin_object.tally['multi_p'].z_bounds, expected_zbounds) # Test error and part data values match expected_part_data = [ 7.5083E-04, 1.7570E-04, 3.3361E-05, 1.1232E-03, 3.4735E-04, 1.5816E-04, 6.2264E-04, 2.3071E-04, 8.3469E-05, 1.6700E-03, 4.1785E-04, 7.6990E-05, 3.3842E-03, 9.2931E-04, 2.4958E-04, 1.0121E-03, 2.7993E-04, 6.1043E-05, 7.7401E-04, 3.2480E-04, 9.3145E-06, 1.4245E-03, 4.3352E-04, 1.7392E-04, 7.3166E-04, 2.4210E-04, 1.4804E-04 ] expected_error_data = [ 2.2149E+01, 7.4509E+01, 1.0000E+02, 2.4621E+01, 4.6383E+01, 3.3621E+01, 2.1616E+01, 7.5885E+01, 1.0000E+02, 2.0067E+01, 3.3654E+01, 6.1265E+01, 1.8407E+01, 1.6239E+01, 5.2119E+01, 1.5791E+01, 3.8452E+01, 1.0000E+02, 7.6577E+00, 3.5290E+01, 1.0000E+02, 8.3702E+00, 5.3283E+01, 6.2602E+01, 1.1655E+01, 6.2289E+01, 6.7541E+01 ] for i, v_e in enumerate( usrbin_object.tally['multi_p'].structured_iterate_hex("zyx")): read = usrbin_object.tally['multi_p'].part_data_tag[v_e] assert_equal( usrbin_object.tally['multi_p'].part_data_tag.name, 'part_data_7') expected = expected_part_data[i] assert_equal(read, expected) for i, v_e in enumerate( usrbin_object.tally['multi_p'].structured_iterate_hex("zyx")): read = usrbin_object.tally['multi_p'].error_data_tag[v_e] assert_equal( usrbin_object.tally['multi_p'].error_data_tag.name, 'error_data_7') expected = expected_error_data[i] assert_equal(read, expected) # Tally #2: # Test UsrbinTally attributes expected_xbounds = [-3.0, 0.0, 3.0, 6.0] expected_ybounds = [-3.0, -1.0, 1.0, 3.0] expected_zbounds = [-3.0, -2.0, -1.0, 0.0] assert_equal(usrbin_object.tally['multi_n'].coord_sys, 'Cartesian') assert_equal(usrbin_object.tally['multi_n'].name, 'multi_n') assert_equal(usrbin_object.tally['multi_n'].particle, '8') assert_equal(usrbin_object.tally['multi_n'].x_bounds, expected_xbounds) assert_equal(usrbin_object.tally['multi_n'].y_bounds, expected_ybounds) assert_equal(usrbin_object.tally['multi_n'].z_bounds, expected_zbounds) # Test error and part data values match expected_part_data = [ 1.0984E-02, 4.1051E-03, 1.0636E-03, 2.1837E-02, 5.5610E-03, 1.9119E-03, 1.0971E-02, 3.3943E-03, 1.2456E-03, 1.6615E-02, 2.9501E-03, 7.4597E-04, 1.0395E-01, 6.1186E-03, 1.4997E-03, 1.7421E-02, 3.0824E-03, 7.3878E-04, 1.8097E-02, 5.2532E-03, 2.1572E-03, 1.0465E-01, 6.2611E-03, 1.8829E-03, 1.7323E-02, 5.5092E-03, 2.1418E-03 ] expected_error_data = [ 5.0179E+00, 1.6521E+01, 1.3973E+01, 4.2025E+00, 8.1766E+00, 1.1465E+01, 7.2005E+00, 1.0479E+01, 1.5640E+01, 5.5994E+00, 1.3275E+01, 2.7617E+01, 7.3788E-01, 6.7200E+00, 1.9092E+01, 7.3670E+00, 1.3018E+01, 2.8866E+01, 5.7221E+00, 1.5916E+01, 2.6001E+01, 8.3490E-01, 1.6715E+01, 1.2759E+01, 5.0763E+00, 1.1420E+01, 1.0040E+01 ] for i, v_e in enumerate( usrbin_object.tally['multi_n'].structured_iterate_hex("zyx")): read = usrbin_object.tally['multi_n'].part_data_tag[v_e] assert usrbin_object.tally['multi_n'].part_data_tag.name == 'part_data_8' expected = expected_part_data[i] assert_equal(read, expected) for i, v_e in enumerate( usrbin_object.tally['multi_n'].structured_iterate_hex("zyx")): read = usrbin_object.tally['multi_n'].error_data_tag[v_e] assert usrbin_object.tally['multi_n'].error_data_tag.name == 'error_data_8' expected = expected_error_data[i] assert_equal(read, expected)
def test_degenerate_usrbin(): """Test usrbin file containing tallies with different number of bins in each direction. """ if not HAVE_PYMOAB: raise SkipTest thisdir = os.path.dirname(__file__) usrbin_file = os.path.join(thisdir, "fluka_usrbin_degenerate.lis") usrbin_object = fluka.Usrbin(usrbin_file) # Tally #1: # Test UsrbinTally attributes expected_xbounds = [-3.0, 0.0, 3.0, 6.0] expected_ybounds = [-3.0, 0.0, 3.0] expected_zbounds = [-3.0, 0.0] assert_equal(usrbin_object.tally['degen1'].coord_sys, 'Cartesian') assert_equal(usrbin_object.tally['degen1'].name, 'degen1') assert_equal(usrbin_object.tally['degen1'].particle, '8') assert_equal(usrbin_object.tally['degen1'].x_bounds, expected_xbounds) assert_equal(usrbin_object.tally['degen1'].y_bounds, expected_ybounds) assert_equal(usrbin_object.tally['degen1'].z_bounds, expected_zbounds) # Test error and part data values match expected_part_data = [ 3.5279E-02, 4.7334E-03, 1.4458E-03, 3.6242E-02, 4.6521E-03, 1.5292E-03 ] expected_error_data = [ 1.2016E+00, 6.4313E+00, 7.7312E+00, 2.0235E+00, 9.4199E+00, 8.0514E+00 ] for i, v_e in enumerate( usrbin_object.tally['degen1'].structured_iterate_hex("zyx")): read = usrbin_object.tally['degen1'].part_data_tag[v_e] assert usrbin_object.tally['degen1'].part_data_tag.name == 'part_data_8' expected = expected_part_data[i] assert_equal(read, expected) for i, v_e in enumerate( usrbin_object.tally['degen1'].structured_iterate_hex("zyx")): read = usrbin_object.tally['degen1'].error_data_tag[v_e] assert usrbin_object.tally['degen1'].error_data_tag.name == 'error_data_8' expected = expected_error_data[i] assert_equal(read, expected) # Tally #2: # Test UsrbinTally attributes expected_xbounds = [-3.0, 1.5, 6.0] expected_ybounds = [-3.0, 3.0] expected_zbounds = [-3.0, -2.0, -1.0, 0.0] assert_equal(usrbin_object.tally['degen2'].coord_sys, 'Cartesian') assert_equal(usrbin_object.tally['degen2'].name, 'degen2') assert_equal(usrbin_object.tally['degen2'].particle, '8') assert_equal(usrbin_object.tally['degen2'].x_bounds, expected_xbounds) assert_equal(usrbin_object.tally['degen2'].y_bounds, expected_ybounds) assert_equal(usrbin_object.tally['degen2'].z_bounds, expected_zbounds) # Test error and part data values match expected_part_data = [ 1.1543E-02, 2.0295E-03, 3.2603E-02, 1.4229E-03, 3.3492E-02, 2.7923E-03 ] expected_error_data = [ 2.7321E+00, 5.2342E+00, 7.4679E-01, 4.2862E+00, 1.3090E+00, 1.4151E+01 ] for i, v_e in enumerate( usrbin_object.tally['degen2'].structured_iterate_hex("zyx")): read = usrbin_object.tally['degen2'].part_data_tag[v_e] assert usrbin_object.tally['degen2'].part_data_tag.name == 'part_data_8' expected = expected_part_data[i] assert_equal(read, expected) for i, v_e in enumerate( usrbin_object.tally['degen2'].structured_iterate_hex("zyx")): read = usrbin_object.tally['degen2'].error_data_tag[v_e] assert usrbin_object.tally['degen2'].error_data_tag.name == 'error_data_8' expected = expected_error_data[i] assert_equal(read, expected) # Tally #3: # Test UsrbinTally attributes expected_xbounds = [-3.0, 6.0] expected_ybounds = [-3.0, -1.0, 1.0, 3.0] expected_zbounds = [-3.0, -1.5, 0.0] assert_equal(usrbin_object.tally['degen3'].coord_sys, 'Cartesian') assert_equal(usrbin_object.tally['degen3'].name, 'degen3') assert_equal(usrbin_object.tally['degen3'].particle, '8') assert_equal(usrbin_object.tally['degen3'].x_bounds, expected_xbounds) assert_equal(usrbin_object.tally['degen3'].y_bounds, expected_ybounds) assert_equal(usrbin_object.tally['degen3'].z_bounds, expected_zbounds) # Test error and part data values match expected_part_data = [ 5.8037E-03, 1.3260E-02, 5.6046E-03, 7.9677E-03, 4.3111E-02, 8.1349E-03 ] expected_error_data = [ 6.1913E+00, 2.3684E+00, 4.6124E+00, 3.2523E+00, 1.3714E+00, 4.3161E+00 ] for i, v_e in enumerate( usrbin_object.tally['degen3'].structured_iterate_hex("zyx")): read = usrbin_object.tally['degen3'].part_data_tag[v_e] assert usrbin_object.tally['degen3'].part_data_tag.name == 'part_data_8' expected = expected_part_data[i] assert_equal(read, expected) for i, v_e in enumerate( usrbin_object.tally['degen3'].structured_iterate_hex("zyx")): read = usrbin_object.tally['degen3'].error_data_tag[v_e] assert usrbin_object.tally['degen3'].error_data_tag.name == 'error_data_8' expected = expected_error_data[i] assert_equal(read, expected)