EnsembleSampler error
- emcee version: 2.2.1
- platform: Windows 7
- installation method (pip/conda/source/other?):pip
I'm having this message: Traceback (most recent call last):
File "
File "C:\Users\Adriana\Anaconda3\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 827, in runfile execfile(filename, namespace)
File "C:\Users\Adriana\Anaconda3\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 110, in execfile exec(compile(f.read(), filename, 'exec'), namespace)
File "C:/Users/Adriana/Anaconda3/Lib/site-packages/radvel/borrar ya.py", line 18, in
File "C:\Users\Adriana\Anaconda3\lib\site-packages\emcee\ensemble.py", line 91, in init super(EnsembleSampler, self).init(dim, lnpostfn, args=args,
TypeError: super(type, obj): obj must be an instance or subtype of type
This happens when I run:
import numpy as np import emcee
def lnprob(x, ivar): return -0.5 * np.sum(ivar * x ** 2)
ndim, nwalkers = 10, 100 ivar = 1. / np.random.rand(ndim) p0 = [np.random.rand(ndim) for i in range(nwalkers)]
sampler = emcee.EnsembleSampler(nwalkers, ndim, lnprob, args=[ivar]) sampler.run_mcmc(p0, 1000)
This suggests that there's some sort of general problem with the Python installation, but I'm not sure what to suggest! It could have something to do with running within spyder (I don't have any experience with that - sorry!).
Perhaps you should try uninstalling emcee (a few times) and then installing it again from scratch?