Skip to content

Commit

Permalink
Add unit test for decay method
Browse files Browse the repository at this point in the history
  • Loading branch information
vg3095 committed Jul 4, 2017
1 parent 541897d commit aa49e27
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions tardis/io/tests/test_decay.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,19 @@
import pandas as pd

from tardis.io.decay import IsotopeAbundances
from numpy.testing import assert_almost_equal

@pytest.fixture
def simple_abundance_model():
index = pd.MultiIndex.from_tuples([(28, 56)],
names=['atomic_number', 'mass_number'])
return IsotopeAbundances([[1.0, 1.0]], index=index)


def test_simple_decay(simple_abundance_model):
1/0
decayed_abundance = simple_abundance_model.decay(100)
assert_almost_equal(decayed_abundance.ix[26, 56][0], 0.55752)
assert_almost_equal(decayed_abundance.ix[26, 56][1], 0.55752)
assert_almost_equal(decayed_abundance.ix[27, 56][0], 0.4423791)
assert_almost_equal(decayed_abundance.ix[27, 56][1], 0.4423791)
assert_almost_equal(decayed_abundance.ix[28, 56][0], 1.1086e-05)
assert_almost_equal(decayed_abundance.ix[28, 56][1], 1.1086e-05)

0 comments on commit aa49e27

Please sign in to comment.