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

mflike-plik branch: import is broken #78

Open
JesusTorrado opened this issue Jun 17, 2024 · 1 comment
Open

mflike-plik branch: import is broken #78

JesusTorrado opened this issue Jun 17, 2024 · 1 comment
Assignees

Comments

@JesusTorrado
Copy link

Hi,

We are reimplementing the way Cobaya deals with external likelihoods, to gain some new features, such as automatic installation with a simple mention in the input file. I was starting by adding the external likelihoods which are already in
https://cobaya.readthedocs.io/en/latest/likelihood_external.html#list-of-external-packages

Among them, there is a reference to a class implemented in the mplike-plik branch. The installation in that case works, but it throws an error at importing, breaking the workflow of the installer:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/jesus/projects/coco/venv/lib/python3.11/site-packages/plikmflike/__init__.py", line 1, in <module>
    from .plikmflike import PlikMFLike
  File "/home/jesus/projects/coco/venv/lib/python3.11/site-packages/plikmflike/plikmflike.py", line 339, in <module>
    ksz = fgc.FactorizedCrossSpectrum(fgf.ConstantSED(), fgp.kSZ_Planck())
                                                         ^^^^^^^^^^^^^^^^
  File "/home/jesus/projects/coco/venv/lib/python3.11/site-packages/plikmflike/fgspectra/power.py", line 105, in __init__
    spec = np.genfromtxt(_get_power_file('ksz_planck'))
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/jesus/projects/coco/venv/lib/python3.11/site-packages/plikmflike/fgspectra/power.py", line 24, in _get_power_file
    raise ValueError('No template for model '+filename+' found in ' + str(data_path) + ' ls: ' + str(os.listdir(data_path)))
                                                                                                     ^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: './plikmflike/fgspectra/data/'

I reckon it has to do with data files not being included, as specified in the README, but the error should be thrown at instantiation, not at import, don't you think?

In any case, does it make sense to add this likelihood (the one in the mflike-plik branch) to the new list, or will it be superseded soon by a new version?

@xgarrido
Copy link
Collaborator

I assign this issue to @HTJense since he is the author of this branch and likelihood.

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

3 participants