'dict_keys' object has no attribute 'index' error when following 'Anomalous diffusion' example in docs
Hello, I'm using python 3.6.5 and I get the following error when trying to run through the Anomalous diffusion example:
.../bayesloop/transitionModels.py in computeForwardPrior(self, posterior, t)
100 ndarray: Prior parameter distribution for subsequent time step
101 """
--> 102 axisToTransform = self.study.observationModel.parameterNames.index(self.selectedParameter)
103 normedSigma = self.hyperParameterValues[0]/self.latticeConstant[axisToTransform]
104
AttributeError: 'dict_keys' object has no attribute 'index'
The line of code in the example:
L = bl.om.SymPy(normal, {'D': bl.oint(0, 15, 5000)})
Should be changed to:
L = bl.om.SymPy(normal, 'D', bl.oint(0, 15, 5000))
Unless you want to deal with version issues for indexing dict_keys.
You're right, the dictionary was part of an older syntax for SymPy models. Thanks for pointing it out. Fixed in the lastest docs (e364aa8).
Hi, In this version of the docs, the issue is still present in the tutorial: http://docs.bayesloop.com/en/latest/examples/anomalousdiffusion.html
Hi @BenediktK, thanks for pointing this out! The docs haven't been updated in a long time, will try to do the update soon!