LSSTDESC / SLTimer

Time delay measurement from LSST light curves
BSD 3-Clause "New" or "Revised" License
5 stars 5 forks source link

Binder needs SLTimer setup #29

Closed drphilmarshall closed 8 years ago

drphilmarshall commented 8 years ago

Hmm. Should we add the SLTimer package itself to the requirements.txt file? Or try and run the setup.sh script from the notebooks, to make sure the PYTHONPATH is set correctly? I'm leaning towards the former but it seems odd to list the package itself inside its own requirements.txt. Thoughts, @jchiang87 ?

drphilmarshall commented 8 years ago

Error message was this one, btw:

ImportError Traceback (most recent call last)

in () 1 from **future** import print_function 2 get_ipython().magic(u'matplotlib inline') ----> 3 from desc.sltimer import * 4 get_ipython().magic(u'load_ext autoreload') 5 get_ipython().magic(u'autoreload 2') ImportError: No module named desc.sltimer
jchiang87 commented 8 years ago

Would adding itself to the requirements.txt file actually work? I think the most straight-forward solution would be to add the needed directory path directly to sys.path, i.e., before from desc.sltimer import * add the lines

import sys
sys.path.append('../python')

since it seems to be running from the notebooks subfolder. If you wanted to be explicit, you could instead do

import sys
sys.path.append('/home/main/notebooks/python')
drphilmarshall commented 8 years ago

Fixed in #30!