本文整理汇总了Python中pyne.material.Material.alara方法的典型用法代码示例。如果您正苦于以下问题:Python Material.alara方法的具体用法?Python Material.alara怎么用?Python Material.alara使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyne.material.Material
的用法示例。
在下文中一共展示了Material.alara方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_alara
# 需要导入模块: from pyne.material import Material [as 别名]
# 或者: from pyne.material.Material import alara [as 别名]
def test_alara():
leu = Material(nucvec={'U235': 0.04, 'U238': 0.96}, metadata={\
'mat_number':2, 'table_ids':{'922350':'15c', '922380':'25c'},\
'name':'LEU', 'source':'Some URL', \
'comments': \
'this is a long comment that will definitly go over the 80 character limit, for science', \
}, density=19.1)
leu2 = Material(nucvec={'U235': 0.04, 'U238': 0.96}, metadata={\
'mat_number':2,}, density=19.1)
leu3 = Material(nucvec={'U235': 0.04, 'U238': 0.96})
written = leu.alara()
written += leu2.alara()
written += leu3.alara()
expected = ('# mat number: 2\n'
'# source: Some URL\n'
'# comments: this is a long comment that will definitly go over the 80 character\n'
'# limit, for science\n'
'LEU 19.1 2\n'
' u:235 4.0000E-02 92\n'
' u:238 9.6000E-01 92\n'
'# mat number: 2\n'
'mat2_rho-19.1 19.1 2\n'
' u:235 4.0000E-02 92\n'
' u:238 9.6000E-01 92\n'
'mat<mat_num>_rho-<rho> <rho> 2\n'
' u:235 4.0000E-02 92\n'
' u:238 9.6000E-01 92\n')
assert_equal(written, expected)