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

Relative path in source/MulensModel/data #159

Open
jenniferyee opened this issue Dec 5, 2024 · 2 comments
Open

Relative path in source/MulensModel/data #159

jenniferyee opened this issue Dec 5, 2024 · 2 comments

Comments

@jenniferyee
Copy link
Collaborator

L51-55 of init.py are
"""
path_1 = path.join(MODULE_PATH, 'data')
if path.isdir(path_1):
DATA_PATH = path_1
else:
DATA_PATH = path.join(path.dirname(file), 'data')
"""

This points to source/MulensModel/data

That file points to ../../data

This is a relative path, which is generally bad practice, and it seems the reason is that it doesn't always work. For instance, when MulensModel is installed via Google Colab, it can't find interpolation_table_b0b1_v3.dat.

Why is DATA_PATH set up this way? Why can't we set it up without the relative paths?

@rpoleski
Copy link
Owner

rpoleski commented Dec 5, 2024

This if statement is there because of different paths for pip install and PYTHONPATH installations. I'm guessing Google Colab uses pip install or similar.
Right now I don't know how to set it up without path.dirname().

@rpoleski
Copy link
Owner

rpoleski commented Dec 5, 2024

@jenniferyee Ok, a quick fix for the user would be to download a release from github, move the data directory, change path in __init__.py and run installation based on local files.

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

No branches or pull requests

2 participants