question about contrib models MorrisLecar

26 views
Skip to first unread message

thierry.r...@gmail.com

unread,
Jan 14, 2021, 4:20:43 AM1/14/21
to TVB Users
Dear TVB users and developers,
I have installed TVB following along the instructions reported here:
and I wanted to use the Morris Lecar model for didactical purposes.
However in my installation I do not have the folder contrib folder, so neither contrib/simulator/models that hosts the morris_lecar.py file.
I have created the folder and placed the morris_lecar file (https://github.com/the-virtual-brain/tvb-root/blob/master/tvb_contrib/tvb/contrib/simulator/models/morris_lecar.py) in that folder. 

Unfortunately even then I am running in the following error:

~/anaconda3/envs/tvb-run/lib/python3.7/site-packages/tvb/contrib/simulator/models/morris_lecar.py in __init__(self, **kwargs) 178 179 """ --> 180 LOG.info('%s: initing...' % str(self)) 181 super(MorrisLecar, self).__init__(**kwargs) 182 ~/anaconda3/envs/tvb-run/lib/python3.7/site-packages/tvb/basic/neotraits/_core.py in __str__(self) 183 184 def __str__(self): --> 185 return trait_object_str(self) 186 187 def _repr_html_(self): ~/anaconda3/envs/tvb-run/lib/python3.7/site-packages/tvb/basic/neotraits/info.py in trait_object_str(self) 133 def trait_object_str(self): 134 cls = type(self) --> 135 summary = self.summary_info() 136 result = ['{} ('.format(cls.__name__)] 137 maxlenk = max(len(k) for k in summary) ~/anaconda3/envs/tvb-run/lib/python3.7/site-packages/tvb/basic/neotraits/_core.py in summary_info(self) 237 cls = type(self) 238 ret = {'Type': cls.__name__} --> 239 if self.title: 240 ret['title'] = str(self.title) 241 AttributeError: 'MorrisLecar' object has no attribute 'title'

The code is:
import tvb.simulator.models as models
from tvb.contrib.simulator.models import morris_lecar
import numpy as np
dt=0.1
integ = integrators.HeunDeterministic(dt=dt)
oscil = morris_lecar.MorrisLecar() #variables_of_interest=['V','N'],gCa=np.array([4.])) - same 

I am wondering if there is maybe a more proper way to install the contrib and how to make it run. 

Thanks in advance.

Thierry

Lia Domide

unread,
Jan 14, 2021, 6:34:38 AM1/14/21
to TVB Users
Hi Thierry,

It seems that your environment is not completely set-up. Under `tvb_root` you have folder `tvb_contrib` were python module `tvb.contrib` is hosted.

       cd tvb_contrib
       python setup.py develop --no-deps 

Anyway, after `import tvb.contrib` works, I am able to reproduce your error. 
It seem to be a problem with the way these models (from under tvb_contrib) were translated (apparently incompletely) towards Python 3 and our neo-traits.
To make your example run, you should switch the two lines in morris_lecar.py, constructor MorrisLecar. __init__

       super(MorrisLecar, self).__init__(**kwargs)

       LOG.info('%s: initing...' % str(self))


We will add a task in the following development sprints to have these models fixed.

Let us know how these work for you.

Best,
Lia Domide
TVB technical team

Reply all
Reply to author
Forward
0 new messages