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

Update the document "Concept 2: Dynamical System" #435

Merged
merged 1 commit into from
Aug 10, 2023
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
4 changes: 2 additions & 2 deletions brainpy/_src/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ def save(self, *args, **kwargs) -> None:
"""Save shared arguments in the global context."""
assert len(args) % 2 == 0
for i in range(0, len(args), 2):
identifier = args[i * 2]
data = args[i * 2 + 1]
identifier = args[i]
data = args[i + 1]
self._arguments[identifier] = data
for identifier, data in kwargs.items():
self._arguments[identifier] = data
Expand Down
10 changes: 5 additions & 5 deletions brainpy/_src/dynsys.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def update(self, x):
return func


class DynamicalSystem(bm.BrainPyObject, DelayRegister):
class DynamicalSystem(bm.BrainPyObject, DelayRegister, ReceiveInputProj):
"""Base Dynamical System class.

.. note::
Expand Down Expand Up @@ -120,6 +120,9 @@ def __init__(
f'which are parents of {self.supported_modes}, '
f'but we got {self.mode}.')

# Attribute for "ReceiveInputProj"
self.cur_inputs = bm.node_dict()

# local delay variables:
# Compatible for ``DelayRegister``
# TODO: will be deprecated in the future
Expand Down Expand Up @@ -573,7 +576,7 @@ def reset_state(self, *args, **kwargs):
pass


class Dynamic(DynamicalSystem, ReceiveInputProj):
class Dynamic(DynamicalSystem):
"""Base class to model dynamics.

There are several essential attributes:
Expand Down Expand Up @@ -629,9 +632,6 @@ def __init__(
# initialize
super().__init__(name=name, mode=mode)

# Attribute for "ReceiveInputProj"
self.cur_inputs = bm.node_dict()

@property
def varshape(self):
"""The shape of variables in the neuron group."""
Expand Down
Loading