Closed JeffValenti closed 5 years ago
The warning is caused by line 18 of ExoCTK/ExoCTK/contam_visibility/visibilityPA.py
:
matplotlib.use('Agg')
Since the warning says the statement has no effect, I commented it out to suppress the warning:
# matplotlib.use('Agg')
The error is caused by line 6 of ExoCTK/ExoCTK/contam_visibility/sossContamFig.py
:
from bokeh.io import gridplot, show
The issue is that gridplot
is in bokeh.layouts
, not bokeh.io
. I replaced the line above with these two lines:
from bokeh.io import show
from bokeh.layouts import gridplot
These changes fixed the warning and the error described above.
After the changes above, attempting to import ExoCTK
raises a new issue:
>>> import ExoCTK
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/valenti/ExoCTK/ExoCTK/__init__.py", line 16, in <module>
from . import contam_visibility
File "/Users/valenti/ExoCTK/ExoCTK/contam_visibility/__init__.py", line 14, in <module>
from . import sossFieldSim
File "/Users/valenti/ExoCTK/ExoCTK/contam_visibility/sossFieldSim.py", line 9, in <module>
import idlsave
ModuleNotFoundError: No module named 'idlsave'
The issue is that I didn't install idlsave
in my conda
environment. The idlsave
repository says, "IDLSave has now been merged into Scipy, and can be used as scipy.io.readsav".
ExoCTK
already requires scipy
. Also, scipy
is available via the default conda
channel. Thus, I switched the code from idlsave
to readsav
. Here are the original lines of code:
import idlsave
...
modelParam = idlsave.read(os.path.join(idlsave_path,'modelsInfo.sav'),verbose=False)
...
modelO12 = idlsave.read(fNameModO12,verbose=False)['modelo12']
and here are the new lines of code:
from scipy.io import readsav
...
modelParam = readsav(os.path.join(idlsave_path,'modelsInfo.sav'),verbose=False)
...
modelO12 = readsav(fNameModO12,verbose=False)['modelo12']
These changes address the idlsave
issue, which wasn't really an error.
After the changes above, attempting to import ExoCTK
raises a new error:
>>> import ExoCTK
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/valenti/junk/ExoCTK/ExoCTK/__init__.py", line 17, in <module>
from . import forward_models
File "/Users/valenti/junk/ExoCTK/ExoCTK/forward_models/__init__.py", line 5, in <module>
from . import exotransmit
File "/Users/valenti/junk/ExoCTK/ExoCTK/forward_models/exotransmit.py", line 2, in <module>
from . import _exotransmit_wrapper
ImportError: cannot import name '_exotransmit_wrapper'
The problem is that the Cython code in ExoCTK/ExoCTK/forward_models/_exotransmit_wrapper.pyx
is not getting cythonized into _exotransmit_wrapper.c
.
I tracked the problem down to three instances of pal
in setup files. We recently changed our package names from short abbreviations to longer descriptions. pal
became forward_models
.
The file ExoCTK/setup.cfg
contained the lines:
[entry_points]
exotransmit = ExoCTK.pal._exotransmit_wrapper:exotransmit
collect_exotransmit_data = ExoCTK.pal.exotransmit:collect_exotransmit_data
which I changed to:
[entry_points]
exotransmit = ExoCTK.forward_models._exotransmit_wrapper:exotransmit
collect_exotransmit_data = ExoCTK.forward_models.exotransmit:collect_exotransmit_data
The file ExoCTK/ExoCTK/forward_models/setup_package.py
contained the line:
return [Extension(name='ExoCTK.pal._exotransmit_wrapper',
which I changed to:
return [Extension(name='ExoCTK.forward_models._exotransmit_wrapper',
These changes alone don't seem to fix the error. Exiting and restarting python yields the same error. Using pip
to uninstall and then install ExoCTK again yields the same error. Removing and recreating the conda environment yields the same error. Perhaps the earlier failed install left some improper files around that don't get cleaned up by pip uninstall ExoCTK
.
@JeffValenti Try installing again. The Travis tests are all passing so this may be resolved. Thanks!
I installed Miniconda with python 3.6 on a Mac:
I created a Miniconda environment named
exoctk
:I cloned master (d1f2efa2047be309727822274bedbe7c535aa3a4):
Install reports success:
Importing ExoCTK prints a warning:
and later raises and error: