mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-26 21:25:36 -04:00
reverting to pytest.approx
Co-authored-by: Ethan Peterson <ethan.peterson@mit.edu>
This commit is contained in:
parent
39eaf9d887
commit
75d82a7df7
1 changed files with 5 additions and 8 deletions
|
|
@ -507,14 +507,11 @@ def test_get_activity():
|
|||
m4 = openmc.Material()
|
||||
m4.add_nuclide("H3", 1)
|
||||
m4.set_density('g/cm3', 1.5)
|
||||
assert m4.get_activity(normalization='mass') == 355978108155965.94 # [Bq/g]
|
||||
assert m4.get_activity(normalization='mass', by_nuclide=True) == {
|
||||
"H3": 355978108155965.94 # [Bq/g]
|
||||
}
|
||||
assert m4.get_activity(normalization='volume') == 355978108155965.94*3/2 # [Bq/cc]
|
||||
assert m4.get_activity(normalization='volume', by_nuclide=True) == {
|
||||
"H3": 355978108155965.94*3/2 # [Bq/cc]
|
||||
assert pytest.approx(m4.get_activity(normalization='mass')) == 355978108155965.94 # [Bq/g]
|
||||
assert pytest.approx(m4.get_activity(normalization='mass', by_nuclide=True)["H3"]) == 355978108155965.94 # [Bq/g]
|
||||
assert pytest.approx(m4.get_activity(normalization='volume')) == 355978108155965.94*3/2 # [Bq/cc]
|
||||
assert pytest.approx(m4.get_activity(normalization='volume', by_nuclide=True)["H3"]) == 355978108155965.94*3/2 # [Bq/cc]
|
||||
}
|
||||
# volume is required to calculate total activity
|
||||
m4.volume = 10.
|
||||
assert m4.get_activity(normalization='total') == 355978108155965.94*3/2*10 # [Bq]
|
||||
assert pytest.approx(m4.get_activity(normalization='total')) == 355978108155965.94*3/2*10 # [Bq]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue