How to upgrade to version 1.0#

When changing from version 0.x.y to 1.0.0 (or later), we have made several changes to the public interface of Jaxley. This how-to guide describes the changes that users have to make to get their models to run on version 1.0.

Updating custom ion channel models#

Every function of an ion channel (including update_states and compute_current) must now receive all of the following arguments, in that order:

self,
channel_states: dict[str, Array],
channel_params: dict[str, Array],
voltage: Array,
delta_t: float,

For an example, see here.

Updating custom synapses#

Every function of every synapse (including update_states and compute_current) must now receive all of the following arguments, in that order:

self,
synapse_states: dict[str, Array],
synapse_params: dict[str, Array],
pre_voltage: Array,
post_voltage: Array,
pre_states: dict[str, Array],
post_states: dict[str, Array],
pre_params: dict[str, Array],
post_params: dict[str, Array],
delta_t: float,

For an example, see here.

Recovering Na, K, and Leak channels#

In old version, the Na, K, and Leak channels were based on an implementation of Pospischil et al. In the new version (1.0 or later), the Na, K, and Leak channels are the same channels as the ones that are part of the HH mechanism. To use the Pospischil channels instead, do:

pip install jaxley-mech
from jaxley_mech.channels.pospischil import Na, K, Leak, CaL, CaT, M

Recovering TanH synapses#

We have removed the TanhConductanceSynapse and the TanhRateSynapse. To recover these synapses, do:

For TanhConductanceSynapse:

import jax.numpy as jnp
from jaxley.synapses import ConductanceSynapse
connect(..., ConductanceSynapse(jnp.tanh))

For TanhRateSynapse:

import jax.numpy as jnp
from jaxley.synapses import CurrentSynapse
connect(..., CurrentSynapse(jnp.tanh))