cnr-ibf-pa / hbp-bsp-issues

Ticketing system for developers/testers and power users of the Brain Simulation Platform of the Human Brain Project
4 stars 0 forks source link

Python3 update for "KappaNEURON" notebook #512

Open alex4200 opened 4 years ago

alex4200 commented 4 years ago

Expected behavior

Should work for python3

Actual Behavior (please include screenshot if possible)

Several incompatibility issues.

Steps to reproduce the problem

  1. Clone notebook
  2. Change kernel
  3. Run all cells

Optional infrastructural data (user, platform, browser, environment, ...)

Guidelines

When updating the notebook you might consider some of the Guidelines to provide an improved look & feel.

davidcsterratt commented 4 years ago

I'm under severe time pressure at the moment, as I officially finished work on HBP in December, but I'm hoping to get a student working on this over the summer.

davidcsterratt commented 4 years ago

I now have a student set to work on this over the summer.

antonelepfl commented 4 years ago

@alex4200 Please check if it working. Otherwise we will disable it.

alex4200 commented 4 years ago

It seems the use case is not working correctly. In a cell I get the following error

TypeErrorTraceback (most recent call last)
<ipython-input-9-0b78530c6cf9> in <module>()
     10 ## Create the link between the Kappa model and the species just defined
     11 kappa = KappaNEURON.Kappa(membrane_species=[ca], species=[P],
---> 12 kappa_file='caPump2.ka', regions=[r])

/opt/conda/envs/python2/lib/python2.7/site-packages/KappaNEURON/__init__.pyc in __init__(self, *args, **kwargs)
    351         # initialize self if the rest of rxd is already initialized
    352         if nrr.initializer.is_initialized():
--> 353             self._update_indices()
    354 
    355         ## Create Kappa simulations and register them with KappaNEURON and NEURON

/home/jovyan/.local/nrn/lib/python/neuron/rxd/generalizedReaction.pyc in _update_indices(self)
    125             sp_regions = list({sptr()._region for sptr in self._sources}.union({sptr()._region for sptr in self._dests}))
    126         else:
--> 127             sp_regions = list(set.intersection(*[set(sptr()._regions) if isinstance(sptr(),species.Species) else {sptr()._region}  for sptr in self._sources + self._dests]))
    128 
    129         #The reactants do not share a common region

TypeError: descriptor 'intersection' of 'set' object needs an argument

which does not look trivial. I will disable the usecase then.

antonelepfl commented 4 years ago

This Use Case will be disabled for SGA2 and moved to SGA3