From aa49e27f1dd385b7cfa3706e4e1a25ad8a72f00e Mon Sep 17 00:00:00 2001 From: Vaibhav Gupta Date: Mon, 3 Jul 2017 20:05:37 +0530 Subject: [PATCH] Add unit test for decay method --- tardis/io/tests/test_decay.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tardis/io/tests/test_decay.py b/tardis/io/tests/test_decay.py index d6e0b180d82..ad16c81e2cd 100644 --- a/tardis/io/tests/test_decay.py +++ b/tardis/io/tests/test_decay.py @@ -2,6 +2,7 @@ import pandas as pd from tardis.io.decay import IsotopeAbundances +from numpy.testing import assert_almost_equal @pytest.fixture def simple_abundance_model(): @@ -9,6 +10,11 @@ def simple_abundance_model(): 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)