Skip to content

Commit

Permalink
Hopefully RTD works (#36)
Browse files Browse the repository at this point in the history
* Fixed a bug that caused an error when multiple different types were created

* Updated the backprop example

* Minor changes to prepare for new release

* Minor change

* Version changes

* Minor changes

* Hopefullt fixed version system

* Updated changelog

* Trying to fix RTD errors

* Grrr

* grrrrrr

* Fixed bugs with RTD not allowing RTD to build
  • Loading branch information
mpgl authored Jun 7, 2024
1 parent 227ab56 commit ead07ae
Show file tree
Hide file tree
Showing 8 changed files with 35 additions and 16 deletions.
4 changes: 4 additions & 0 deletions dendrify/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
19 changes: 10 additions & 9 deletions dendrify/neuronmodel.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
9 changes: 9 additions & 0 deletions docs_sphinx/source/changelog.rst
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
11 changes: 8 additions & 3 deletions docs_sphinx/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 -----------------------------------------------------
Expand Down
Binary file modified docs_sphinx/source/examples/_static/comp_backprop.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs_sphinx/source/examples/comp_backprop.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion examples_new/comp_backprop.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
@@ -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()
Expand All @@ -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",
Expand Down

0 comments on commit ead07ae

Please sign in to comment.