NEURON 7.7.1 RxD issue

Extending NEURON to handle reaction-diffusion problems.

Moderators: hines, wwlytton, ramcdougal

Post Reply
bremen
Posts: 45
Joined: Mon Apr 24, 2017 8:15 am
Location: Italy

NEURON 7.7.1 RxD issue

Post by bremen »

Hello.

I haven't worked on my RxD model for months and now, after installing the latest NEURON version from git (3 october 2019) to be up to date, my code give rise to an error.

The issue is generated by reactions with species placed across different locations, in this case, the soma of two distinct cells and the ecs.

Code: Select all

soma_cell_1 = rxd.Region([cell_1.soma], nrn_region='i', geometry=rxd.Shell(0.8, 1))
species_x = rxd.Species([soma_cell_1, ecs, soma_cell_2], name='species_x', d=1, charge=1, initial=0,  ecs_boundary_conditions=0)
reaction_1 = rxd.Reaction(Species_y >Species_z + species_x, 0.058, regions = [soma_cell_1])

Code: Select all

Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/neuron/rxd/rxd.py", line 1529, in _init
    initializer._do_init()
  File "/usr/local/lib/python2.7/dist-packages/neuron/rxd/initializer.py", line 51, in _do_init
    obj._do_init()
  File "/usr/local/lib/python2.7/dist-packages/neuron/rxd/reaction.py", line 82, in _do_init
    self._update_rates()
  File "/usr/local/lib/python2.7/dist-packages/neuron/rxd/reaction.py", line 141, in _update_rates
    self._rate, self._involved_species = rxdmath._compile(rate, self._react_regions)
  File "/usr/local/lib/python2.7/dist-packages/neuron/rxd/rxdmath.py", line 95, in _compile
    s = arith._semi_compile(reg, instruction)
  File "/usr/local/lib/python2.7/dist-packages/neuron/rxd/rxdmath.py", line 537, in _semi_compile
    items_append(item._semi_compile(region, instruction))
  File "/usr/local/lib/python2.7/dist-packages/neuron/rxd/rxdmath.py", line 342, in _semi_compile
    return '(%s)*(%s)' % (self._a._semi_compile(region, instruction), self._b._semi_compile(region, instruction))
  File "/usr/local/lib/python2.7/dist-packages/neuron/rxd/rxdmath.py", line 537, in _semi_compile
    items_append(item._semi_compile(region, instruction))
  File "/usr/local/lib/python2.7/dist-packages/neuron/rxd/species.py", line 215, in _semi_compile
    raise RxDException("Species %r is not defined on region %r." % (self, reg))
neuron.rxd.rxdException.RxDException: Species Species(regions=[Region(..., nrn_region='i', geometry=Shell(lo=0.8, hi=1), dx=0.25, name=None)], d=0.1, name='no_GC', charge=1, initial=0) is not defined on region Region(..., nrn_region='i', geometry=Shell(lo=0.8, hi=1), dx=0.25, name=None).
nrn/nrn/x86_64/bin/nrniv: Python Callback failed
 near line 0
Python 2.7 and NEURON 7.7.1

Best

Stefano
adamjhn
Posts: 54
Joined: Tue Apr 18, 2017 10:05 am

Re: NEURON 7.7.1 RxD issue

Post by adamjhn »

Thanks for getting in touch, this is a bug where the reaction tries to find rate strings for all regions the species are defined on rather than the just the region specified in the constructor.

A fix has just been pushed to the github; https://github.com/neuronsimulator/nrn

Alternatively, a possible workaround would be to define the species on the same regions, the reaction will be able to find the rate strings, but only the one for the region specified would be compiled.
bremen
Posts: 45
Joined: Mon Apr 24, 2017 8:15 am
Location: Italy

Re: NEURON 7.7.1 RxD issue

Post by bremen »

Hi.

The fix solved the issue.
Thank you.

Best
Stefano
Post Reply