NeuralEnsemble / PyNN

A Python package for simulator-independent specification of neuronal network models.
Other
275 stars 125 forks source link

Error when creating a PointNeuron with no synaptic mechanisms, with brian2 backend #798

Closed apdavison closed 4 months ago

apdavison commented 4 months ago

When running a simulation with a composed neuron model with only a neuron component, no synapse components, the brian2 backend gives an error.

Example of cell type:

cell = sim.PointNeuron(
    sim.AdExp(
        cm=123.5 * 1e-3,
        tau_refrac=2.47,
        v_spike=10,
        v_reset=-51,
        v_rest=-96.2,
        tau_m=3.5283698074395744, # 123.5 / (8.6 * 4.07)
        i_offset=0.0,
        a=-14.5,
        b=500.0 * 1e-3,
        delta_T=16,
        tau_w=15,
        v_thresh=-51,
    )
)

Error message:

Traceback (most recent call last):
  File "/Users/adavison/dev/simulation/PyNN/examples/trying_AdEx-v2.py", line 49, in <module>
    SPN_cell = sim.PointNeuron(
               ^^^^^^^^^^^^^^^^
  File "/Users/adavison/dev/simulation/PyNN/pyNN/brian2/standardmodels/cells.py", line 344, in __init__
    self.eqs += brian2.Equations(synaptic_current_equation)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/adavison/dev/simulation/env-202404/lib/python3.11/site-packages/brian2/equations/equations.py", line 620, in __init__
    self._equations = parse_string_equations(eqns)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/adavison/dev/simulation/env-202404/lib/python3.11/site-packages/brian2/utils/caching.py", line 107, in cached_func
    func._cache[cache_key] = func(*args, **kwds)
                             ^^^^^^^^^^^^^^^^^^^
  File "/Users/adavison/dev/simulation/env-202404/lib/python3.11/site-packages/brian2/equations/equations.py", line 389, in parse_string_equations
    raise EquationError(
brian2.equations.equations.EquationError: Parsing failed:
i_syn =  : amp
^
Expected end of text, found 'i'  (at char 0), (line:1, col:1)

Thanks to Ilaria Carannante for the bug report.