Possible pycamb persistence issue


In [1]:
from __future__ import print_function
import camb
print(camb.__version__)


0.1.6.1

In [2]:
test_z = 1100.

Param set 1


In [3]:
pars1 = camb.CAMBparams()
pars1.set_cosmology(H0=75.0,mnu=0.06)
pars1.InitPower.set_params()
results1 = camb.get_background(pars1)

We calculate comoving distance to test_z


In [4]:
chi1 = results1.comoving_radial_distance(test_z)
print("Comoving distance for param set 1 : ",chi1)


Comoving distance for param set 1 :  13597.074431119912

Param set 2


In [5]:
pars2 = camb.CAMBparams()
pars2.set_cosmology(H0=65.0,mnu=0.180)
pars2.InitPower.set_params()
results2 = camb.get_background(pars2)

We calculate comoving distance for this new cosmology


In [6]:
chi2 = results2.comoving_radial_distance(test_z)
print("Comoving distance for param set 2 : ",chi2)


Comoving distance for param set 2 :  13935.85748861403

Revisiting param set 1


In [7]:
chi1_again = results1.comoving_radial_distance(test_z)
print("Comoving distance for param set 1 : ",chi1_again)


Comoving distance for param set 1 :  13935.85748861403

In [8]:
assert chi1==chi1_again


---------------------------------------------------------------------------
AssertionError                            Traceback (most recent call last)
<ipython-input-8-b753887589dd> in <module>()
----> 1 assert chi1==chi1_again

AssertionError: