File tree Expand file tree Collapse file tree 2 files changed +23
-0
lines changed Expand file tree Collapse file tree 2 files changed +23
-0
lines changed Original file line number Diff line number Diff line change 2
2
from . import math_tools
3
3
from . import print_tools
4
4
from . import str_tools
5
+
6
+ from .__version__ import __version__
Original file line number Diff line number Diff line change @@ -10,3 +10,24 @@ def test_z_to_cMpc_zero():
10
10
# Zero redshift should give zero distance
11
11
dist = 0.0
12
12
assert pyxcosmo .z_to_cMpc (0 ).value == dist
13
+
14
+ def test_z_to_cMpc_array ():
15
+ # Must return an array
16
+ dist = np .array ([0.0 , 3395.905416665515 ])
17
+ assert (pyxcosmo .z_to_cMpc (np .array ([0 , 1 ])).value == dist ).all
18
+
19
+ def test_cMpc_to_z_float ():
20
+ z = 0.8479314667609102
21
+ assert pyxcosmo .cMpc_to_z (3000 ) == z
22
+
23
+ def test_z_to_cMpc_zero ():
24
+ # Zero distance should give zero redshift
25
+ z = 0.0
26
+ assert pyxcosmo .cMpc_to_z (0 ) == z
27
+
28
+ def test_z_to_cMpc_array ():
29
+ # Must return an array
30
+ z = np .array ([0.0 , 0.8479314667609102 ])
31
+ assert (pyxcosmo .z_to_cMpc (np .array ([0.0 , 3000 ])).value == z ).all
32
+
33
+
You can’t perform that action at this time.
0 commit comments