From 955fbd07108031291f3d2b34218f20f44d07a89b Mon Sep 17 00:00:00 2001 From: SexyERIC0723 Date: Fri, 27 Mar 2026 18:26:11 +0000 Subject: [PATCH 1/2] fix: correct missing self parameter, stale docstrings, and minor type issues - Add missing `self` parameter to `Synapse.update_states()` and `Synapse.compute_current()` base class methods. All concrete subclasses already include `self`; the base class was inconsistent. - Update current unit in docstrings from `uA/cm2` to `mA/cm2` in `channel.py`. The unit was changed in v0.5.0 but the docstrings were not updated. - Fix invalid `np.ndarray[bool]` type annotation in `connect.py`. `np.ndarray` does not support subscript type parameters. - Remove duplicate `Callable` import in `integrate.py`. It was imported from both `collections.abc` and `typing`. --- jaxley/channels/channel.py | 4 ++-- jaxley/connect.py | 2 +- jaxley/integrate.py | 2 +- jaxley/synapses/synapse.py | 2 ++ 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/jaxley/channels/channel.py b/jaxley/channels/channel.py index a9252c651..7b37cb618 100644 --- a/jaxley/channels/channel.py +++ b/jaxley/channels/channel.py @@ -16,7 +16,7 @@ class Channel: As in NEURON, a `Channel` is considered a distributed process, which means that its conductances are to be specified in `S/cm2` and its currents are to be specified in - `uA/cm2`.""" + `mA/cm2`.""" _name = None channel_params = None @@ -96,7 +96,7 @@ def compute_current( params: Parameters of the channel (conductances in `S/cm2`). Returns: - Current in `uA/cm2`. + Current in `mA/cm2`. """ raise NotImplementedError diff --git a/jaxley/connect.py b/jaxley/connect.py index 41269e2a9..68c35a79b 100644 --- a/jaxley/connect.py +++ b/jaxley/connect.py @@ -260,7 +260,7 @@ def connectivity_matrix_connect( pre_cell_view: "View", post_cell_view: "View", synapse_type: "Synapse", - connectivity_matrix: np.ndarray[bool], + connectivity_matrix: np.ndarray, random_post_comp: bool = False, ): """Connect cells of a network with synapses via a boolean connectivity matrix. diff --git a/jaxley/integrate.py b/jaxley/integrate.py index 918051e6e..d303e2ab0 100644 --- a/jaxley/integrate.py +++ b/jaxley/integrate.py @@ -2,7 +2,7 @@ # licensed under the Apache License Version 2.0, see from collections.abc import Callable from math import prod -from typing import Callable, Dict, List, Optional, Tuple, Union +from typing import Dict, List, Optional, Tuple, Union import jax import jax.numpy as jnp diff --git a/jaxley/synapses/synapse.py b/jaxley/synapses/synapse.py index 98d255ea5..fa4b33d0b 100644 --- a/jaxley/synapses/synapse.py +++ b/jaxley/synapses/synapse.py @@ -58,6 +58,7 @@ def change_name(self, new_name: str): return self def update_states( + self, states: dict[str, Array], delta_t: float, pre_voltage: ArrayLike, @@ -78,6 +79,7 @@ def update_states( raise NotImplementedError def compute_current( + self, states: dict[str, Array], pre_voltage: ArrayLike, post_voltage: ArrayLike, From b6d9d2f4d1e60c681b5c60574fa4971b340b8b63 Mon Sep 17 00:00:00 2001 From: SexyERIC0723 Date: Sat, 28 Mar 2026 12:11:55 +0000 Subject: [PATCH 2/2] docs: add changelog entry for #792 --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b816363f5..e8e9580c9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ Implements Brette et al. (2005), 'Adaptive exponential integrate-and-fire model - Fix issue where `build_dynamic_state_utils` `remove_observables` performed in-place deletions on full state dict (#775, @chaseking) - Allow data_clamp to clamp multiple different states without silently only clamping the last state (#773, @kyralianaka) and fixed checkpointing for this case (#786, @kyralianaka) - Fix issue causing some `View`s to take too long to create (#791, @alexpejovic) +- Fix missing `self` in `Synapse` base class, stale `uA/cm2` docstrings, invalid `np.ndarray[bool]` annotation, and duplicate import (#792, @haoyu-haoyu) # 0.13.0