diff --git a/dendrify/__init__.py b/dendrify/__init__.py index 92a8c03..3d28251 100644 --- a/dendrify/__init__.py +++ b/dendrify/__init__.py @@ -3,3 +3,7 @@ update_default_params) from .equations import library from .neuronmodel import NeuronModel, PointNeuronModel + +__version__ = '2.1.4' +__author__ = 'Michalis Pagkalos' +__email__ = 'mpagkalos93@gmail.com' diff --git a/dendrify/neuronmodel.py b/dendrify/neuronmodel.py index 47b6765..7357950 100644 --- a/dendrify/neuronmodel.py +++ b/dendrify/neuronmodel.py @@ -284,15 +284,16 @@ def config_dspikes(self, event_name: str, for comp in self._compartments: if isinstance(comp, Dendrite) and comp._dspike_params: event_id = f"{event_name}_{comp.name}" - dt = defaultclock.dt - d = {f"Vth_{event_id}": threshold, - f"duration_rise_{event_id}": comp._timestep(duration_rise, dt), - f"duration_fall_{event_id}": comp._timestep(duration_fall, dt), - f"E_rise_{event_name}": comp._ionic_param(reversal_rise), - f"E_fall_{event_name}": comp._ionic_param(reversal_fall), - f"offset_fall_{event_id}": comp._timestep(offset_fall, dt), - f"refractory_{event_id}": comp._timestep(refractory, dt)} - comp._dspike_params[event_id].update(d) + if event_id in comp._dspike_params: + dt = defaultclock.dt + d = {f"Vth_{event_id}": threshold, + f"duration_rise_{event_id}": comp._timestep(duration_rise, dt), + f"duration_fall_{event_id}": comp._timestep(duration_fall, dt), + f"E_rise_{event_name}": comp._ionic_param(reversal_rise), + f"E_fall_{event_name}": comp._ionic_param(reversal_fall), + f"offset_fall_{event_id}": comp._timestep(offset_fall, dt), + f"refractory_{event_id}": comp._timestep(refractory, dt)} + comp._dspike_params[event_id].update(d) def make_neurongroup(self, N: int, diff --git a/docs_sphinx/source/changelog.rst b/docs_sphinx/source/changelog.rst index b1f42dd..82864bf 100644 --- a/docs_sphinx/source/changelog.rst +++ b/docs_sphinx/source/changelog.rst @@ -1,6 +1,15 @@ Release notes ============= +Version 2.1.4 +------------- + * Fixed a bug that raised an error when config_dspikes was called multiple times + to configure different dSpike types. Thank you Tim Bax for discovering and + reporting this issue. + * Checked compatibility with Brian 2.7.0. + * Added package metadata (e.g. dendrify.__version__ works now). + * Minor documentation improvements. + Version 2.1.3 ------------- * Changed package requirements to fix installation conflicts with Brian 2.6.0. diff --git a/docs_sphinx/source/conf.py b/docs_sphinx/source/conf.py index c7e376d..31337f2 100644 --- a/docs_sphinx/source/conf.py +++ b/docs_sphinx/source/conf.py @@ -3,17 +3,22 @@ # For the full list of built-in configuration values, see the documentation: # https://www.sphinx-doc.org/en/master/usage/configuration.html -import os -import sys +import os, sys sys.path.insert(0, os.path.abspath('../..')) sys.path.insert(0, os.path.abspath('../../..')) + + # -- Project information ------------------------------------------------------- project = 'Dendrify' copyright = '2024, Michalis Pagkalos' author = 'Michalis Pagkalos' -release = '2.1.3' +release = '2.1.4' +# release = re.search( +# r'__version__\s*=\s*[\'"]([^\'"]*)[\'"]', +# io.open('dendrify/__init__.py', encoding='utf_8_sig').read() +# ).group(1) # -- General configuration ----------------------------------------------------- diff --git a/docs_sphinx/source/examples/_static/comp_backprop.png b/docs_sphinx/source/examples/_static/comp_backprop.png index ee82e33..64676cc 100644 Binary files a/docs_sphinx/source/examples/_static/comp_backprop.png and b/docs_sphinx/source/examples/_static/comp_backprop.png differ diff --git a/docs_sphinx/source/examples/comp_backprop.rst b/docs_sphinx/source/examples/comp_backprop.rst index 8410857..8f7d447 100644 --- a/docs_sphinx/source/examples/comp_backprop.rst +++ b/docs_sphinx/source/examples/comp_backprop.rst @@ -74,7 +74,7 @@ In this example we show: # Run simulation net = b.Network(neuron, ap_reset, M) net.run(10*ms) - neuron.I_ext_soma = 150*pA + neuron.I_ext_soma = 115*pA net.run(100*ms) neuron.I_ext_soma = 0*pA net.run(60*ms) diff --git a/examples_new/comp_backprop.py b/examples_new/comp_backprop.py index 122fb03..a827520 100644 --- a/examples_new/comp_backprop.py +++ b/examples_new/comp_backprop.py @@ -75,7 +75,7 @@ # Run simulation net = b.Network(neuron, ap_reset, M) net.run(10*ms) -neuron.I_ext_soma = 150*pA +neuron.I_ext_soma = 115*pA net.run(100*ms) neuron.I_ext_soma = 0*pA net.run(60*ms) diff --git a/setup.py b/setup.py index a0a29e2..f2b2b8a 100644 --- a/setup.py +++ b/setup.py @@ -1,6 +1,6 @@ from setuptools import find_packages, setup +VERSION = '2.1.4' -VERSION = '2.1.3' DESCRIPTION = 'A package for adding dendrites to SNNs' with open("README.rst") as f: LONG_DESCRIPTION = f.read() @@ -15,7 +15,7 @@ long_description_content_type="text/x-rst; charset=UTF-8", long_description=LONG_DESCRIPTION, packages=find_packages(), - install_requires=['brian2==2.6.0'], + install_requires=['brian2==2.7.0'], keywords=['python', 'brian2', 'dendrites', 'SNNs', 'network models'], classifiers=[ "Development Status :: 5 - Production/Stable",