lesgourg / class_public

Public repository of the Cosmic Linear Anisotropy Solving System (master for the most recent version of the standard code; GW_CLASS to include Cosmic Gravitational Wave Background anisotropies; classnet branch for acceleration with neutral networks; ExoCLASS branch for exotic energy injection; class_matter branch for FFTlog)
230 stars 285 forks source link

Error when working with python wrapper #303

Open zboero opened 4 years ago

zboero commented 4 years ago

Hello,

I would be please if someone could guide me in sorting the following error message that I face when I try to run CLASS in python:


CosmoComputationError Traceback (most recent call last)

in ----> 1 my_model.compute() ~/class/python/classy.pyx in classy.Class.compute() 335 if background_init(&(self.pr), &(self.ba)) == _FAILURE_: 336 self.struct_cleanup() --> 337 raise CosmoComputationError(self.ba.error_message) 338 self.ncp.add("background") 339 CosmoComputationError: Error in Class: background_init(L:701) :error in background_solve(ppr,pba); =>background_solve(L:1654) :condition ((tau_end-tau_start)/tau_start < ppr->smallest_allowed_variation) is true; integration step: relative change in time =-nan < machine precision : leads either to numerical error or infinite loop ------------------------------------------------------------------------------------------------------------------ I'm running CLASS simply with the following script: import numpy as np import matplotlib.pyplot as plt import scipy.special as sp from classy import Class my_model = Class() # Input parameters my_model.set({'omega_b':0.022032,'omega_cdm':0.12038,'h':0.67556,'A_s':2.215e-9,'n_s':0.9619,'tau_reio':0.0925}) my_model.set({'output':'tCl,pCl,lCl,mPk','lensing':'yes','P_k_max_1/Mpc':3.0}) # run class my_model.compute() Thanks in advance,
cscoccola commented 4 years ago

Hi! I've tried your script, and it worked fine for me... I haven't got any error message.

zboero commented 4 years ago

Hi! I've tried your script, and it worked fine for me... I haven't got any error message.

Thank you for the answer! I couldn't identify the error but I fixed it by installing it again. Regards