dfm/emcee

Suggestion for page /user/upgrade.html

astromark opened this issue · 2 comments

I've been upgrading some old code to emcee 3. One issue I came across is that many of the sampler methods are now of type state, which cannot take an index. For example, I had these lines in my code that worked previously:

for i, result in enumerate(sampler.sample(pos, iterations=nsteps)):
	position = result[0]

but this needed to be rewritten as:

for i, result in enumerate(sampler.sample(pos, iterations=nsteps)):
	position = result.coords

I think some commentary on this page would be useful for anyone else who runs into this issue when upgrading old code.

dfm commented

Thanks! Instead of updating the docs, I propose that we make your old syntax just work again. Over in #425 I've added this feature.

That sounds like an even better idea! Thanks!