Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CosmoSevereError after pip install classy #578

Open
AlexandreBarthelemy opened this issue Apr 17, 2024 · 1 comment
Open

CosmoSevereError after pip install classy #578

AlexandreBarthelemy opened this issue Apr 17, 2024 · 1 comment

Comments

@AlexandreBarthelemy
Copy link

AlexandreBarthelemy commented Apr 17, 2024

Hi,

I used to compile CLASS from source but I decided to try out the new pip install classy command with my new laptop (m1 mac in case the info is relevant). The installation runs without any issues, as well as importing the library.

I'm now trying to run this piece of code:

import classy
print(classy.__version__)
from classy import Class

cosmo = {
    'output':           'mPk',
    'P_k_max_1/Mpc':    100,
    'h':                0.7,
    'n_s':              0.97,
    'Omega_cdm':        0.233,
    'Omega_b':          0.046,
    'sigma8':           0.82,
    'N_ncdm':           0,
    'z_pk':             0.5, 
    'non linear':       'halofit'
}

cclass = Class()
cclass.set(cosmo)
cclass.compute()

but now runs into errors that were not present in my previous installation:

CosmoSevereError                          Traceback (most recent call last)
Cell In[4], line 21
     19 cclass = Class()
     20 cclass.set(cosmo)
---> 21 cclass.compute()

File /opt/miniconda3/lib/python3.9/site-packages/class_public/python/classy.pyx:364, in classy.Class.compute()

CosmoSevereError: 

Error in Class: input_read_from_file(L:422) :error in input_shooting(pfc,ppr,pba,pth,ppt,ptr,ppm,phr,pfo,ple,psd,pop, input_verbose, &has_shooting, errmsg);
=>input_shooting(L:836) :error in input_try_unknown_parameters(&A_s, 1, &fzw, &sigma8_or_S8, errmsg);
=>input_try_unknown_parameters(L:1416) :error in thermodynamics_init(&pr,&ba,&th);
=>thermodynamics_init(L:344) :error in thermodynamics_helium_from_bbn(ppr,pba,pth);
=>thermodynamics_helium_from_bbn(L:589) :could not open fA with name /Users/Alexandre/.local/lib/python3.9/site-packages/class_public/external/bbn/sBBN_2017.dat and mode "r"

Given that I'm not sure if those come from the pip install or just the switch from 3.1.2 to 3.2.3, could someone explain those to me and tell me what I'm eventually doing wrong ?

Thanks a lot for your help :)

@AlexandreBarthelemy
Copy link
Author

Just for reference and additional information:

I just built the same class version (3.2.3) from source without installing any additional packages and the previously shown piece of code now runs without any issue. I thus think it's really an issue with the pip installation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant