I am very new to dadi, and python for that matter, so it is probably
something I have done incorrectly. Installing your newest version
1.6.1 from source on a mac OS X 10.6.8 I get the following error when
running the example (or test cases):
bash-3.2$ python YRI_CEU.py
Traceback (most recent call last):
File "YRI_CEU.py", line 5, in <module>
import dadi
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/
lib/python2.7/site-packages/dadi-1.6.1-py2.7-macosx-10.6-x86_64.egg/
dadi/__init__.py", line 11, in <module>
import Demographics1D
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/
lib/python2.7/site-packages/dadi-1.6.1-py2.7-macosx-10.6-x86_64.egg/
dadi/Demographics1D.py", line 6, in <module>
from dadi import Numerics, PhiManip, Integration
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/
lib/python2.7/site-packages/dadi-1.6.1-py2.7-macosx-10.6-x86_64.egg/
dadi/Numerics.py", line 7, in <module>
from scipy import comb
ImportError: cannot import name comb
I can fix this by changing the line to "from scipy.misc import
comb" (see http://www.pyinstaller.org/ticket/83 for a similar
problem), and then have to do the same in Spectrum_mod.py. But then
when I run the example with the optimize_log lines uncommented (lines
46,51-58) I get:
bash-3.2$ python YRI_CEU.py
Model log-likelihood: -1066.34607559
Traceback (most recent call last):
File "YRI_CEU.py", line 54, in <module>
verbose=len(params))
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/
lib/python2.7/site-packages/dadi-1.6.1-py2.7-macosx-10.6-x86_64.egg/
dadi/Inference.py", line 147, in optimize_log
maxiter=maxiter)
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/
lib/python2.7/site-packages/scipy/optimize/optimize.py", line 515, in
fmin_bfgs
gfk = myfprime(x0)
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/
lib/python2.7/site-packages/scipy/optimize/optimize.py", line 176, in
function_wrapper
return function(x, *args)
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/
lib/python2.7/site-packages/scipy/optimize/optimize.py", line 393, in
approx_fprime
f0 = f(*((xk,)+args))
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/
lib/python2.7/site-packages/scipy/optimize/optimize.py", line 176, in
function_wrapper
return function(x, *args)
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/
lib/python2.7/site-packages/dadi-1.6.1-py2.7-macosx-10.6-x86_64.egg/
dadi/Inference.py", line 68, in _object_func_log
return _object_func(numpy.exp(log_params), *args, **kwargs)
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/
lib/python2.7/site-packages/dadi-1.6.1-py2.7-macosx-10.6-x86_64.egg/
dadi/Inference.py", line 47, in _object_func
sfs = model_func(*all_args, **func_kwargs)
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/
lib/python2.7/site-packages/dadi-1.6.1-py2.7-macosx-10.6-x86_64.egg/
dadi/Numerics.py", line 306, in extrap_func
result_l = map(partial_func, pts_l)
TypeError: prior_onegrow_mig() got multiple values for keyword
argument 'pts'
I am using python 2.7.2 not the system python. The source of the
problem is likely something I have done, but any help you can give
would be great,
Tim