Page 1 of 1

NEURON 7.7.1 RxD issue

Posted: Thu Oct 03, 2019 8:45 am
by bremen

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/", line 1529, in _init
  File "/usr/local/lib/python2.7/dist-packages/neuron/rxd/", line 51, in _do_init
  File "/usr/local/lib/python2.7/dist-packages/neuron/rxd/", line 82, in _do_init
  File "/usr/local/lib/python2.7/dist-packages/neuron/rxd/", 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/", line 95, in _compile
    s = arith._semi_compile(reg, instruction)
  File "/usr/local/lib/python2.7/dist-packages/neuron/rxd/", line 537, in _semi_compile
    items_append(item._semi_compile(region, instruction))
  File "/usr/local/lib/python2.7/dist-packages/neuron/rxd/", 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/", line 537, in _semi_compile
    items_append(item._semi_compile(region, instruction))
  File "/usr/local/lib/python2.7/dist-packages/neuron/rxd/", 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



Re: NEURON 7.7.1 RxD issue

Posted: Thu Oct 03, 2019 3:21 pm
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;

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.

Re: NEURON 7.7.1 RxD issue

Posted: Mon Oct 07, 2019 2:52 pm
by bremen

The fix solved the issue.
Thank you.