Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

get the deserved name: brainpy #168

Merged
merged 3 commits into from
Apr 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ BrainPy is a flexible, efficient, and extensible framework for computational neu
BrainPy is based on Python (>=3.7) and can be installed on Linux (Ubuntu 16.04 or later), macOS (10.12 or later), and Windows platforms. Install the latest version of BrainPy:

```bash
$ pip install brain-py -U
$ pip install brainpy -U
```

The following packages are required for ``BrainPy``:
Expand Down
2 changes: 1 addition & 1 deletion brainpy/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-

__version__ = "2.1.4"
__version__ = "2.1.5"


try:
Expand Down
3 changes: 2 additions & 1 deletion brainpy/dyn/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
from brainpy.errors import ModelBuildError
from brainpy.integrators.base import Integrator
from brainpy.types import Tensor
from .utils import init_delay

__all__ = [
'DynamicalSystem',
Expand Down Expand Up @@ -468,6 +467,7 @@ def register_delay(
# delay variable
if domain == 'local':
self.local_delay_vars[name] = bm.LengthDelay(delay_target, max_delay_step, initial_delay_data)
self.register_implicit_nodes(self.local_delay_vars)
else:
if name not in self.global_delay_vars:
self.global_delay_vars[name] = bm.LengthDelay(delay_target, max_delay_step, initial_delay_data)
Expand All @@ -477,6 +477,7 @@ def register_delay(
else:
if self.global_delay_vars[name].num_delay_step - 1 < max_delay_step:
self.global_delay_vars[name].init(delay_target, max_delay_step, initial_delay_data)
self.register_implicit_nodes(self.global_delay_vars)
return delay_step

def get_delay(
Expand Down
13 changes: 6 additions & 7 deletions brainpy/dyn/synapses/abstract_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,13 +139,12 @@ def __init__(
delay_target=self.pre.spike)

def update(self, _t, _dt):
# get delay
# delays
if self.delay_step is None:
pre_spike = self.pre.spike
else:
pre_spike = self.get_delay(self.pre.name + '.spike', delay_step=self.delay_step)
# update delay
self.update_delay(self.pre.name + '.spike', delay_target=self.pre.spike)
self.update_delay(self.pre.name + '.spike', delay_target=self.pre.spike)

# post values
assert self.weight_type in ['homo', 'heter']
Expand Down Expand Up @@ -321,7 +320,7 @@ def update(self, _t, _dt):
delayed_pre_spike = self.pre.spike
else:
delayed_pre_spike = self.get_delay(self.pre.name + '.spike', self.delay_step)
self.update_delay(self.pre.name + '.spike', self.pre.spike)
self.update_delay(self.pre.name + '.spike', self.pre.spike)

# post values
if isinstance(self.conn, All2All):
Expand Down Expand Up @@ -451,7 +450,7 @@ def update(self, _t, _dt):
delayed_spike = self.pre.spike
else:
delayed_spike = self.get_delay(self.pre.name + '.spike', self.delay_step)
self.update_delay(self.pre.name + '.spike', self.pre.spike)
self.update_delay(self.pre.name + '.spike', self.pre.spike)

# post values
if isinstance(self.conn, All2All):
Expand Down Expand Up @@ -622,7 +621,7 @@ def update(self, _t, _dt):
delayed_pre_spike = self.pre.spike
else:
delayed_pre_spike = self.get_delay(self.pre.name + '.spike', self.delay_step)
self.update_delay(self.pre.name + '.spike', self.pre.spike)
self.update_delay(self.pre.name + '.spike', self.pre.spike)

# post-synaptic values
self.g.value, self.h.value = self.integral(self.g, self.h, _t, _dt)
Expand Down Expand Up @@ -1130,7 +1129,7 @@ def update(self, _t, _dt):
delayed_pre_spike = self.pre.spike
else:
delayed_pre_spike = self.get_delay(self.pre.name + '.spike', self.delay_step)
self.update_delay(self.pre.name + '.spike', self.pre.spike)
self.update_delay(self.pre.name + '.spike', self.pre.spike)

# post-synaptic value
self.g.value, self.x.value = self.integral(self.g, self.x, _t, dt=_dt)
Expand Down
2 changes: 1 addition & 1 deletion brainpy/dyn/synapses/biological_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ def update(self, _t, _dt):
pre_spike = self.pre.spike
else:
pre_spike = self.get_delay(self.pre.name + '.spike', self.delay_step)
self.update_delay(self.pre.name + '.spike', self.pre.spike)
self.update_delay(self.pre.name + '.spike', self.pre.spike)

# spike arrival time
self.spike_arrival_time.value = bm.where(pre_spike, _t, self.spike_arrival_time)
Expand Down
6 changes: 3 additions & 3 deletions docs/quickstart/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,21 @@ To do so, use:

.. code-block:: bash

pip install brain-py
pip install brainpy

To update the BrainPy version, you can use

.. code-block:: bash

pip install -U brain-py
pip install -U brainpy


If you want to install the pre-release version (the latest development version)
of BrainPy, you can use:

.. code-block:: bash

pip install --pre brain-py
pip install --pre brainpy


Installation from source
Expand Down