diff options
-rw-r--r-- | test/test_null.npz | bin | 0 -> 24506 bytes | |||
-rw-r--r-- | test/test_null.py | 26 |
2 files changed, 26 insertions, 0 deletions
diff --git a/test/test_null.npz b/test/test_null.npz Binary files differnew file mode 100644 index 0000000..d970af4 --- /dev/null +++ b/test/test_null.npz diff --git a/test/test_null.py b/test/test_null.py new file mode 100644 index 0000000..56c3031 --- /dev/null +++ b/test/test_null.py @@ -0,0 +1,26 @@ +import os +from unittest import TestCase + +import numpy as np +from numpy.testing import assert_allclose + +from math_utils.array_utils import array_reflect as ar +from nr_analysis_axi import null, invars + +class TestNull(TestCase): + + def setUp(self): + datafile = os.path.splitext(__file__)[0] + '.npz' + + self.data = np.load(datafile) + self.t = ar(self.data['t'], -1) + self.x = ar(self.data['x'], -1) + self.gxx = ar(ar(self.data['gxx'], axis = 1), axis = 0) + self.gtt = ar(ar(self.data['gtt'], axis = 1), axis = 0) + + def test_null_geodesics(self): + g = null.null_geodesics(self.t, self.x, self.gxx, self.gtt, integrate_times = [0.1])[0] + + l = self.data['l'] + + assert_allclose(g(l), self.data['g'], 1e-12) |