Skip to content

Commit

Permalink
doc
Browse files Browse the repository at this point in the history
  • Loading branch information
michaeldeistler committed Dec 18, 2023
1 parent 162d7d2 commit 29689d4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
11 changes: 10 additions & 1 deletion jaxley/modules/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,22 @@ def __str__(self):
return f"jx.{type(self).__name__}"

def _append_params_and_states(self, param_dict, state_dict):
"""Insert the default params of the module (e.g. radius, length).
This is run at `__init__()`. It does not deal with channels.
"""
for param_name, param_value in param_dict.items():
self.nodes[param_name] = param_value
for state_name, state_value in state_dict.items():
self.nodes[state_name] = state_value

def _gather_channels_from_constituents(self, constituents: List) -> None:
"""Modifies `self.channels` and `self.nodes`."""
"""Modify `self.channels` and `self.nodes` with channel info from constituents.
This is run at `__init__()`. It takes all branches of constituents (e.g.
of all branches when the are assembled into a cell) and adds columns to
`.nodes` for the relevant channels.
"""
for module in constituents:
for channel in module.channels:
if type(channel).__name__ not in [
Expand Down
1 change: 0 additions & 1 deletion jaxley/modules/branch.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ def __init__(
self.cumsum_nbranches = jnp.asarray([0, 1])

# Indexing.
# TODO: need to take care of setting the `HH` column to False, not NaN.
self.nodes = pd.concat([c.nodes for c in compartment_list], ignore_index=True)
self._append_params_and_states(self.branch_params, self.branch_states)
self.nodes["comp_index"] = np.arange(self.nseg).tolist()
Expand Down

0 comments on commit 29689d4

Please sign in to comment.