diff --git a/404.html b/404.html index ce1f1892..6973a8ed 100644 --- a/404.html +++ b/404.html @@ -16,7 +16,7 @@ -
To report bugs and suggest features (including better documentation), please equally +
To report bugs and suggest features (including better documentation), please head over to issues on GitHub.
In general, we use pull requests to make changes to jaxley. So, if you are planning to +
jaxley
In general, we use pull requests to make changes to Jaxley. So, if you are planning to make a contribution, please fork, create a feature branch and then make a PR from -your feature branch to the upstream jaxley (details).
Jaxley
Clone the repo and install via setup.py using pip install -e ".[dev]" (the dev flag installs development and testing dependencies).
setup.py
pip install -e ".[dev]"
For docstrings and comments, we use Google Style.
Code needs to pass through the following tools, which are installed alongside jaxley:
Code needs to pass through the following tools, which are installed alongside Jaxley:
black: Automatic code formatting for Python. You can run black manually from the console using black . in the top directory of the repository, which will format all files.
black .
jaxley is a collaborative project between the groups of Jakob Macke (Uni Tübingen), Pedro Gonçalves (KU Leuven / NERF), and Philipp Berens (Uni Tübingen).
Jaxley is a collaborative project between the groups of Jakob Macke (Uni Tübingen), Pedro Gonçalves (KU Leuven / NERF), and Philipp Berens (Uni Tübingen).
jaxley is licensed under the Affero General Public License version 3 (AGPLv3) and
Jaxley is licensed under the Apache License and
-Copyright (C) 2020 Michael Deistler. +Copyright (C) 2024 Michael Deistler, Jakob H. Macke, Pedro J. Goncalves, Philipp Berens.
Copyright (C) 2020 Michael Deistler.
Copyright (C) 2024 Michael Deistler, Jakob H. Macke, Pedro J. Goncalves, Philipp Berens.
If you use jaxley consider citing the corresponding paper: -
@article{deistler, -} +@article{} diff --git a/faq/index.html b/faq/index.html index 0f2c65a6..0118ad27 100644 --- a/faq/index.html +++ b/faq/index.html @@ -22,7 +22,7 @@ - FAQ - jaxley + FAQ - Jaxley @@ -90,7 +90,7 @@ - + @@ -103,7 +103,7 @@ - jaxley + Jaxley @@ -196,12 +196,12 @@ - + - jaxley + Jaxley @@ -410,7 +410,7 @@ - Optimization + Training models @@ -786,7 +786,7 @@ Frequently asked questions¶ -What makes jaxley different from other libraries? +What makes Jaxley different from other libraries? diff --git a/faq/question_01/index.html b/faq/question_01/index.html index eeb48ee1..a4efbf03 100644 --- a/faq/question_01/index.html +++ b/faq/question_01/index.html @@ -18,7 +18,7 @@ - What makes jaxley different from other libraries? - jaxley + What makes jaxley different from other libraries? - Jaxley @@ -86,7 +86,7 @@ - + @@ -99,7 +99,7 @@ - jaxley + Jaxley @@ -192,12 +192,12 @@ - + - jaxley + Jaxley @@ -406,7 +406,7 @@ - Optimization + Training models diff --git a/index.html b/index.html index c490c5c4..4d6dcdff 100644 --- a/index.html +++ b/index.html @@ -20,7 +20,7 @@ - jaxley + Jaxley @@ -72,7 +72,7 @@ - + Skip to content @@ -88,7 +88,7 @@ - + @@ -101,7 +101,7 @@ - jaxley + Jaxley @@ -194,12 +194,12 @@ - + - jaxley + Jaxley @@ -265,9 +265,9 @@ - + - Tutorial + Tutorials @@ -507,7 +507,7 @@ - Optimization + Training models @@ -861,9 +861,9 @@ - + - Tutorial + Tutorials @@ -943,43 +943,46 @@ Home - -jaxley is a differentiable simulator for networks of multicompartment neurons in JAX. Its key features are: + + + + +Jaxley is a differentiable simulator for biophysical neuron models in JAX. Its key features are: automatic differentiation, allowing gradient-based optimization of thousands of parameters -support for CPU and GPU without any changes to the code +support for CPU, GPU, or TPU without any changes to the code jit-compilation, making it as fast as other packages while being fully written in python backward-Euler solver for stable numerical solution of multicompartment neurons elegant mechanisms for parameter sharing -Tutorial¶ -Tutorial notebooks with some explanation are in tutorials. We currently have tutorials on how to: +Tutorials¶ +We currently have tutorials on how to: -simulate morphologically detailed neurons -simulate networks of such neurons -set parameters of cells and networks -speed up simulations with jit and vmap -define your own channels and synapses -define groups -train biophysical models +simulate morphologically detailed neurons +simulate networks of such neurons +set parameters of cells and networks +speed up simulations with jit and vmap +define your own channels and synapses +define groups +train biophysical models -Units¶ -jaxley uses the same units as NEURON. -Installation¶ -jaxley requires that you first download and install tridiax. Then, install jaxley via: -git clone https://github.com/jaxleyverse/jaxley.git -cd jaxley -pip install -e . +Units¶ +Jaxley uses the same units as NEURON. +Installation¶ +Jaxley is available on pypi: +pip install jaxley + +This will install Jaxley with CPU support. If you want GPU support, follow the instructions on the JAX github repository to install JAX with GPU support (in addition to installing Jaxley). For example, for NVIDIA GPUs, run +pip install -U "jax[cuda12]" -Note that pip>=21.3 is required to install the editable version with pyproject.toml see pip docs. -Feedback and Contributions¶ -We welcome any feedback on how jaxley is working for your neuron models and are happy to receive bug reports, pull requests and other feedback (see contribute). We wish to maintain a positive community, please read our Code of Conduct. -Acknowledgements¶ +Feedback and Contributions¶ +We welcome any feedback on how Jaxley is working for your neuron models and are happy to receive bug reports, pull requests and other feedback (see contribute). We wish to maintain a positive community, please read our Code of Conduct. +Acknowledgements¶ We greatly benefited from previous toolboxes for simulating multicompartment neurons, in particular NEURON. -License¶ +License¶ Apache License -Citation¶ -If you use jaxley, consider citing the corresponding paper: +Citation¶ +If you use Jaxley, consider citing the corresponding paper: @article{} diff --git a/install/index.html b/install/index.html index 48aaa6e5..2296b688 100644 --- a/install/index.html +++ b/install/index.html @@ -22,7 +22,7 @@ - Installation - jaxley + Installation - Jaxley @@ -73,6 +73,11 @@ + + + Skip to content + + @@ -85,7 +90,7 @@ - + @@ -98,7 +103,7 @@ - jaxley + Jaxley @@ -191,12 +196,12 @@ - + - jaxley + Jaxley @@ -405,7 +410,7 @@ - Optimization + Training models @@ -436,6 +441,17 @@ + + + + + Installation + + + + + + @@ -446,6 +462,41 @@ + + + + + + + + + + Table of contents + + + + + + + Install the most recent stable version + + + + + + + + + Install from source + + + + + + + + + @@ -760,6 +811,32 @@ + + + Table of contents + + + + + + + Install the most recent stable version + + + + + + + + + Install from source + + + + + + + @@ -778,7 +855,15 @@ Installation -jaxley requires that you first download and install tridiax. Then, install jaxley via: +Install the most recent stable version¶ +Jaxley is available on pypi: +pip install jaxley + +This will install Jaxley with CPU support. If you want GPU support, follow the instructions on the JAX github repository to install JAX with GPU support (in addition to installing Jaxley). For example, for NVIDIA GPUs, run +pip install -U "jax[cuda12]" + +Install from source¶ +You can also install Jaxley from source: git clone https://github.com/jaxleyverse/jaxley.git cd jaxley pip install -e . diff --git a/objects.inv b/objects.inv index a0a4ed37..14170bad 100644 Binary files a/objects.inv and b/objects.inv differ diff --git a/reference/connect/index.html b/reference/connect/index.html index 293e090f..38fe1c42 100644 --- a/reference/connect/index.html +++ b/reference/connect/index.html @@ -22,7 +22,7 @@ - Connecting Cells - jaxley + Connecting Cells - Jaxley @@ -90,7 +90,7 @@ - + @@ -103,7 +103,7 @@ - jaxley + Jaxley @@ -196,12 +196,12 @@ - + - jaxley + Jaxley @@ -410,7 +410,7 @@ - Optimization + Training models diff --git a/reference/integration/index.html b/reference/integration/index.html index d87afb21..9a8eea9f 100644 --- a/reference/integration/index.html +++ b/reference/integration/index.html @@ -22,7 +22,7 @@ - Simulation - jaxley + Simulation - Jaxley @@ -90,7 +90,7 @@ - + @@ -103,7 +103,7 @@ - jaxley + Jaxley @@ -196,12 +196,12 @@ - + - jaxley + Jaxley @@ -410,7 +410,7 @@ - Optimization + Training models diff --git a/reference/mechanisms/index.html b/reference/mechanisms/index.html index fcbade33..ba6cacc3 100644 --- a/reference/mechanisms/index.html +++ b/reference/mechanisms/index.html @@ -22,7 +22,7 @@ - Mechansims - jaxley + Mechansims - Jaxley @@ -90,7 +90,7 @@ - + @@ -103,7 +103,7 @@ - jaxley + Jaxley @@ -196,12 +196,12 @@ - + - jaxley + Jaxley @@ -410,7 +410,7 @@ - Optimization + Training models diff --git a/reference/modules/index.html b/reference/modules/index.html index ce7c3da4..2ad82edb 100644 --- a/reference/modules/index.html +++ b/reference/modules/index.html @@ -22,7 +22,7 @@ - Modules - jaxley + Modules - Jaxley @@ -90,7 +90,7 @@ - + @@ -103,7 +103,7 @@ - jaxley + Jaxley @@ -196,12 +196,12 @@ - + - jaxley + Jaxley @@ -410,7 +410,7 @@ - Optimization + Training models diff --git a/reference/optimize/index.html b/reference/optimize/index.html index 7922e3af..d262ae6b 100644 --- a/reference/optimize/index.html +++ b/reference/optimize/index.html @@ -22,7 +22,7 @@ - Optimization - jaxley + Optimization - Jaxley @@ -90,7 +90,7 @@ - + @@ -103,7 +103,7 @@ - jaxley + Jaxley @@ -196,12 +196,12 @@ - + - jaxley + Jaxley @@ -410,7 +410,7 @@ - Optimization + Training models diff --git a/reference/utils/index.html b/reference/utils/index.html index 1e558d2d..e98428bb 100644 --- a/reference/utils/index.html +++ b/reference/utils/index.html @@ -22,7 +22,7 @@ - Utils - jaxley + Utils - Jaxley @@ -90,7 +90,7 @@ - + @@ -103,7 +103,7 @@ - jaxley + Jaxley @@ -196,12 +196,12 @@ - + - jaxley + Jaxley @@ -410,7 +410,7 @@ - Optimization + Training models @@ -1311,10 +1311,7 @@ Source code in jaxley/utils/cell_utils.py - 161 -162 -163 -164 + 164 165 166 167 @@ -1324,7 +1321,10 @@ 171 172 173 -174def compute_children_indices(parents) -> List[jnp.ndarray]: +174 +175 +176 +177def compute_children_indices(parents) -> List[jnp.ndarray]: """Return all children indices of every branch. Example: @@ -1366,10 +1366,7 @@ Source code in jaxley/utils/cell_utils.py - 220 -221 -222 -223 + 223 224 225 226 @@ -1377,7 +1374,10 @@ 228 229 230 -231def compute_coupling_cond(rad1, rad2, r_a1, r_a2, l1, l2): +231 +232 +233 +234def compute_coupling_cond(rad1, rad2, r_a1, r_a2, l1, l2): """Return the coupling conductance between two compartments. Equations taken from `https://en.wikipedia.org/wiki/Compartmental_neuron_models`. @@ -1422,10 +1422,7 @@ Source code in jaxley/utils/cell_utils.py - 234 -235 -236 -237 + 237 238 239 240 @@ -1442,7 +1439,10 @@ 251 252 253 -254def compute_coupling_cond_branchpoint(rad, r_a, l): +254 +255 +256 +257def compute_coupling_cond_branchpoint(rad, r_a, l): r"""Return the coupling conductance between one compartment and a comp with l=0. From https://en.wikipedia.org/wiki/Compartmental_neuron_models @@ -1493,10 +1493,7 @@ Source code in jaxley/utils/cell_utils.py - 257 -258 -259 -260 + 260 261 262 263 @@ -1505,7 +1502,10 @@ 266 267 268 -269def compute_impact_on_node(rad, r_a, l): +269 +270 +271 +272def compute_impact_on_node(rad, r_a, l): r"""Compute the weight with which a compartment influences its node. In order to satisfy Kirchhoffs current law, the current at a branch point must be @@ -1542,10 +1542,7 @@ Source code in jaxley/utils/cell_utils.py - 352 -353 -354 -355 + 355 356 357 358 @@ -1560,7 +1557,10 @@ 367 368 369 -370def compute_morphology_indices_in_levels( +370 +371 +372 +373def compute_morphology_indices_in_levels( num_branchpoints, child_belongs_to_branchpoint, par_inds, @@ -1665,10 +1665,7 @@ Source code in jaxley/utils/cell_utils.py - 313 -314 -315 -316 + 316 317 318 319 @@ -1682,7 +1679,10 @@ 327 328 329 -330def convert_point_process_to_distributed( +330 +331 +332 +333def convert_point_process_to_distributed( current: jnp.ndarray, radius: jnp.ndarray, length: jnp.ndarray ) -> jnp.ndarray: """Convert current point process (nA) to distributed current (uA/cm2). @@ -1754,15 +1754,15 @@ Source code in jaxley/utils/cell_utils.py - 10 -11 -12 -13 + 13 14 15 16 17 -18def equal_segments(branch_property: list, nseg_per_branch: int): +18 +19 +20 +21def equal_segments(branch_property: list, nseg_per_branch: int): """Generates segments where some property is the same in each segment. Args: @@ -1794,10 +1794,7 @@ Source code in jaxley/utils/cell_utils.py - 177 -178 -179 -180 + 180 181 182 183 @@ -1807,7 +1804,10 @@ 187 188 189 -190def get_num_neighbours( +190 +191 +192 +193def get_num_neighbours( num_children: jnp.ndarray, nseg_per_branch: int, num_branches: int, @@ -1846,10 +1846,7 @@ Source code in jaxley/utils/cell_utils.py - 373 -374 -375 -376 + 376 377 378 379 @@ -1863,7 +1860,10 @@ 387 388 389 -390def group_and_sum( +390 +391 +392 +393def group_and_sum( values_to_sum: jnp.ndarray, inds_to_group_by: jnp.ndarray, num_branchpoints: int ) -> jnp.ndarray: """Group values by whether they have the same integer and sum values within group. @@ -1988,10 +1988,7 @@ Source code in jaxley/utils/cell_utils.py - 193 -194 -195 -196 +
@article{}
What makes jaxley different from other libraries?
What makes Jaxley different from other libraries?
jaxley is a differentiable simulator for networks of multicompartment neurons in JAX. Its key features are:
+ +
Jaxley is a differentiable simulator for biophysical neuron models in JAX. Its key features are:
jit
Tutorial notebooks with some explanation are in tutorials. We currently have tutorials on how to:
tutorials
We currently have tutorials on how to:
jaxley uses the same units as NEURON.
NEURON
jaxley requires that you first download and install tridiax. Then, install jaxley via: -
git clone https://github.com/jaxleyverse/jaxley.git -cd jaxley -pip install -e . +Units¶ +Jaxley uses the same units as NEURON. +Installation¶ +Jaxley is available on pypi: +pip install jaxley + +This will install Jaxley with CPU support. If you want GPU support, follow the instructions on the JAX github repository to install JAX with GPU support (in addition to installing Jaxley). For example, for NVIDIA GPUs, run +pip install -U "jax[cuda12]" -Note that pip>=21.3 is required to install the editable version with pyproject.toml see pip docs. -Feedback and Contributions¶ -We welcome any feedback on how jaxley is working for your neuron models and are happy to receive bug reports, pull requests and other feedback (see contribute). We wish to maintain a positive community, please read our Code of Conduct. -Acknowledgements¶ +Feedback and Contributions¶ +We welcome any feedback on how Jaxley is working for your neuron models and are happy to receive bug reports, pull requests and other feedback (see contribute). We wish to maintain a positive community, please read our Code of Conduct. +Acknowledgements¶ We greatly benefited from previous toolboxes for simulating multicompartment neurons, in particular NEURON. -License¶ +License¶ Apache License -Citation¶ -If you use jaxley, consider citing the corresponding paper: +Citation¶ +If you use Jaxley, consider citing the corresponding paper: @article{} diff --git a/install/index.html b/install/index.html index 48aaa6e5..2296b688 100644 --- a/install/index.html +++ b/install/index.html @@ -22,7 +22,7 @@ - Installation - jaxley + Installation - Jaxley @@ -73,6 +73,11 @@ + + + Skip to content + + @@ -85,7 +90,7 @@ - + @@ -98,7 +103,7 @@ - jaxley + Jaxley @@ -191,12 +196,12 @@ - + - jaxley + Jaxley @@ -405,7 +410,7 @@ - Optimization + Training models @@ -436,6 +441,17 @@ + + + + + Installation + + + + + + @@ -446,6 +462,41 @@ + + + + + + + + + + Table of contents + + + + + + + Install the most recent stable version + + + + + + + + + Install from source + + + + + + + + + @@ -760,6 +811,32 @@ + + + Table of contents + + + + + + + Install the most recent stable version + + + + + + + + + Install from source + + + + + + + @@ -778,7 +855,15 @@ Installation -jaxley requires that you first download and install tridiax. Then, install jaxley via: +Install the most recent stable version¶ +Jaxley is available on pypi: +pip install jaxley + +This will install Jaxley with CPU support. If you want GPU support, follow the instructions on the JAX github repository to install JAX with GPU support (in addition to installing Jaxley). For example, for NVIDIA GPUs, run +pip install -U "jax[cuda12]" + +Install from source¶ +You can also install Jaxley from source: git clone https://github.com/jaxleyverse/jaxley.git cd jaxley pip install -e . diff --git a/objects.inv b/objects.inv index a0a4ed37..14170bad 100644 Binary files a/objects.inv and b/objects.inv differ diff --git a/reference/connect/index.html b/reference/connect/index.html index 293e090f..38fe1c42 100644 --- a/reference/connect/index.html +++ b/reference/connect/index.html @@ -22,7 +22,7 @@ - Connecting Cells - jaxley + Connecting Cells - Jaxley @@ -90,7 +90,7 @@ - + @@ -103,7 +103,7 @@ - jaxley + Jaxley @@ -196,12 +196,12 @@ - + - jaxley + Jaxley @@ -410,7 +410,7 @@ - Optimization + Training models diff --git a/reference/integration/index.html b/reference/integration/index.html index d87afb21..9a8eea9f 100644 --- a/reference/integration/index.html +++ b/reference/integration/index.html @@ -22,7 +22,7 @@ - Simulation - jaxley + Simulation - Jaxley @@ -90,7 +90,7 @@ - + @@ -103,7 +103,7 @@ - jaxley + Jaxley @@ -196,12 +196,12 @@ - + - jaxley + Jaxley @@ -410,7 +410,7 @@ - Optimization + Training models diff --git a/reference/mechanisms/index.html b/reference/mechanisms/index.html index fcbade33..ba6cacc3 100644 --- a/reference/mechanisms/index.html +++ b/reference/mechanisms/index.html @@ -22,7 +22,7 @@ - Mechansims - jaxley + Mechansims - Jaxley @@ -90,7 +90,7 @@ - + @@ -103,7 +103,7 @@ - jaxley + Jaxley @@ -196,12 +196,12 @@ - + - jaxley + Jaxley @@ -410,7 +410,7 @@ - Optimization + Training models diff --git a/reference/modules/index.html b/reference/modules/index.html index ce7c3da4..2ad82edb 100644 --- a/reference/modules/index.html +++ b/reference/modules/index.html @@ -22,7 +22,7 @@ - Modules - jaxley + Modules - Jaxley @@ -90,7 +90,7 @@ - + @@ -103,7 +103,7 @@ - jaxley + Jaxley @@ -196,12 +196,12 @@ - + - jaxley + Jaxley @@ -410,7 +410,7 @@ - Optimization + Training models diff --git a/reference/optimize/index.html b/reference/optimize/index.html index 7922e3af..d262ae6b 100644 --- a/reference/optimize/index.html +++ b/reference/optimize/index.html @@ -22,7 +22,7 @@ - Optimization - jaxley + Optimization - Jaxley @@ -90,7 +90,7 @@ - + @@ -103,7 +103,7 @@ - jaxley + Jaxley @@ -196,12 +196,12 @@ - + - jaxley + Jaxley @@ -410,7 +410,7 @@ - Optimization + Training models diff --git a/reference/utils/index.html b/reference/utils/index.html index 1e558d2d..e98428bb 100644 --- a/reference/utils/index.html +++ b/reference/utils/index.html @@ -22,7 +22,7 @@ - Utils - jaxley + Utils - Jaxley @@ -90,7 +90,7 @@ - + @@ -103,7 +103,7 @@ - jaxley + Jaxley @@ -196,12 +196,12 @@ - + - jaxley + Jaxley @@ -410,7 +410,7 @@ - Optimization + Training models @@ -1311,10 +1311,7 @@ Source code in jaxley/utils/cell_utils.py - 161 -162 -163 -164 + 164 165 166 167 @@ -1324,7 +1321,10 @@ 171 172 173 -174def compute_children_indices(parents) -> List[jnp.ndarray]: +174 +175 +176 +177def compute_children_indices(parents) -> List[jnp.ndarray]: """Return all children indices of every branch. Example: @@ -1366,10 +1366,7 @@ Source code in jaxley/utils/cell_utils.py - 220 -221 -222 -223 + 223 224 225 226 @@ -1377,7 +1374,10 @@ 228 229 230 -231def compute_coupling_cond(rad1, rad2, r_a1, r_a2, l1, l2): +231 +232 +233 +234def compute_coupling_cond(rad1, rad2, r_a1, r_a2, l1, l2): """Return the coupling conductance between two compartments. Equations taken from `https://en.wikipedia.org/wiki/Compartmental_neuron_models`. @@ -1422,10 +1422,7 @@ Source code in jaxley/utils/cell_utils.py - 234 -235 -236 -237 + 237 238 239 240 @@ -1442,7 +1439,10 @@ 251 252 253 -254def compute_coupling_cond_branchpoint(rad, r_a, l): +254 +255 +256 +257def compute_coupling_cond_branchpoint(rad, r_a, l): r"""Return the coupling conductance between one compartment and a comp with l=0. From https://en.wikipedia.org/wiki/Compartmental_neuron_models @@ -1493,10 +1493,7 @@ Source code in jaxley/utils/cell_utils.py - 257 -258 -259 -260 + 260 261 262 263 @@ -1505,7 +1502,10 @@ 266 267 268 -269def compute_impact_on_node(rad, r_a, l): +269 +270 +271 +272def compute_impact_on_node(rad, r_a, l): r"""Compute the weight with which a compartment influences its node. In order to satisfy Kirchhoffs current law, the current at a branch point must be @@ -1542,10 +1542,7 @@ Source code in jaxley/utils/cell_utils.py - 352 -353 -354 -355 + 355 356 357 358 @@ -1560,7 +1557,10 @@ 367 368 369 -370def compute_morphology_indices_in_levels( +370 +371 +372 +373def compute_morphology_indices_in_levels( num_branchpoints, child_belongs_to_branchpoint, par_inds, @@ -1665,10 +1665,7 @@ Source code in jaxley/utils/cell_utils.py - 313 -314 -315 -316 + 316 317 318 319 @@ -1682,7 +1679,10 @@ 327 328 329 -330def convert_point_process_to_distributed( +330 +331 +332 +333def convert_point_process_to_distributed( current: jnp.ndarray, radius: jnp.ndarray, length: jnp.ndarray ) -> jnp.ndarray: """Convert current point process (nA) to distributed current (uA/cm2). @@ -1754,15 +1754,15 @@ Source code in jaxley/utils/cell_utils.py - 10 -11 -12 -13 + 13 14 15 16 17 -18def equal_segments(branch_property: list, nseg_per_branch: int): +18 +19 +20 +21def equal_segments(branch_property: list, nseg_per_branch: int): """Generates segments where some property is the same in each segment. Args: @@ -1794,10 +1794,7 @@ Source code in jaxley/utils/cell_utils.py - 177 -178 -179 -180 + 180 181 182 183 @@ -1807,7 +1804,10 @@ 187 188 189 -190def get_num_neighbours( +190 +191 +192 +193def get_num_neighbours( num_children: jnp.ndarray, nseg_per_branch: int, num_branches: int, @@ -1846,10 +1846,7 @@ Source code in jaxley/utils/cell_utils.py - 373 -374 -375 -376 + 376 377 378 379 @@ -1863,7 +1860,10 @@ 387 388 389 -390def group_and_sum( +390 +391 +392 +393def group_and_sum( values_to_sum: jnp.ndarray, inds_to_group_by: jnp.ndarray, num_branchpoints: int ) -> jnp.ndarray: """Group values by whether they have the same integer and sum values within group. @@ -1988,10 +1988,7 @@ Source code in jaxley/utils/cell_utils.py - 193 -194 -195 -196 +
Jaxley uses the same units as NEURON.
Jaxley is available on pypi: +
pypi
pip install jaxley +
JAX
pip install -U "jax[cuda12]"
Note that pip>=21.3 is required to install the editable version with pyproject.toml see pip docs.
pip>=21.3
pyproject.toml
We welcome any feedback on how jaxley is working for your neuron models and are happy to receive bug reports, pull requests and other feedback (see contribute). We wish to maintain a positive community, please read our Code of Conduct.
We welcome any feedback on how Jaxley is working for your neuron models and are happy to receive bug reports, pull requests and other feedback (see contribute). We wish to maintain a positive community, please read our Code of Conduct.
We greatly benefited from previous toolboxes for simulating multicompartment neurons, in particular NEURON.
Apache License
If you use jaxley, consider citing the corresponding paper: +
If you use Jaxley, consider citing the corresponding paper:
jaxley requires that you first download and install tridiax. Then, install jaxley via: +
pip install -U "jax[cuda12]" +
You can also install Jaxley from source:
git clone https://github.com/jaxleyverse/jaxley.git cd jaxley pip install -e . diff --git a/objects.inv b/objects.inv index a0a4ed37..14170bad 100644 Binary files a/objects.inv and b/objects.inv differ diff --git a/reference/connect/index.html b/reference/connect/index.html index 293e090f..38fe1c42 100644 --- a/reference/connect/index.html +++ b/reference/connect/index.html @@ -22,7 +22,7 @@ - Connecting Cells - jaxley + Connecting Cells - Jaxley @@ -90,7 +90,7 @@ - + @@ -103,7 +103,7 @@ - jaxley + Jaxley @@ -196,12 +196,12 @@ - + - jaxley + Jaxley @@ -410,7 +410,7 @@ - Optimization + Training models diff --git a/reference/integration/index.html b/reference/integration/index.html index d87afb21..9a8eea9f 100644 --- a/reference/integration/index.html +++ b/reference/integration/index.html @@ -22,7 +22,7 @@ - Simulation - jaxley + Simulation - Jaxley @@ -90,7 +90,7 @@ - + @@ -103,7 +103,7 @@ - jaxley + Jaxley @@ -196,12 +196,12 @@ - + - jaxley + Jaxley @@ -410,7 +410,7 @@ - Optimization + Training models diff --git a/reference/mechanisms/index.html b/reference/mechanisms/index.html index fcbade33..ba6cacc3 100644 --- a/reference/mechanisms/index.html +++ b/reference/mechanisms/index.html @@ -22,7 +22,7 @@ - Mechansims - jaxley + Mechansims - Jaxley @@ -90,7 +90,7 @@ - + @@ -103,7 +103,7 @@ - jaxley + Jaxley @@ -196,12 +196,12 @@ - + - jaxley + Jaxley @@ -410,7 +410,7 @@ - Optimization + Training models diff --git a/reference/modules/index.html b/reference/modules/index.html index ce7c3da4..2ad82edb 100644 --- a/reference/modules/index.html +++ b/reference/modules/index.html @@ -22,7 +22,7 @@ - Modules - jaxley + Modules - Jaxley @@ -90,7 +90,7 @@ - + @@ -103,7 +103,7 @@ - jaxley + Jaxley @@ -196,12 +196,12 @@ - + - jaxley + Jaxley @@ -410,7 +410,7 @@ - Optimization + Training models diff --git a/reference/optimize/index.html b/reference/optimize/index.html index 7922e3af..d262ae6b 100644 --- a/reference/optimize/index.html +++ b/reference/optimize/index.html @@ -22,7 +22,7 @@ - Optimization - jaxley + Optimization - Jaxley @@ -90,7 +90,7 @@ - + @@ -103,7 +103,7 @@ - jaxley + Jaxley @@ -196,12 +196,12 @@ - + - jaxley + Jaxley @@ -410,7 +410,7 @@ - Optimization + Training models diff --git a/reference/utils/index.html b/reference/utils/index.html index 1e558d2d..e98428bb 100644 --- a/reference/utils/index.html +++ b/reference/utils/index.html @@ -22,7 +22,7 @@ - Utils - jaxley + Utils - Jaxley @@ -90,7 +90,7 @@ - + @@ -103,7 +103,7 @@ - jaxley + Jaxley @@ -196,12 +196,12 @@ - + - jaxley + Jaxley @@ -410,7 +410,7 @@ - Optimization + Training models @@ -1311,10 +1311,7 @@ Source code in jaxley/utils/cell_utils.py - 161 -162 -163 -164 + 164 165 166 167 @@ -1324,7 +1321,10 @@ 171 172 173 -174def compute_children_indices(parents) -> List[jnp.ndarray]: +174 +175 +176 +177def compute_children_indices(parents) -> List[jnp.ndarray]: """Return all children indices of every branch. Example: @@ -1366,10 +1366,7 @@ Source code in jaxley/utils/cell_utils.py - 220 -221 -222 -223 + 223 224 225 226 @@ -1377,7 +1374,10 @@ 228 229 230 -231def compute_coupling_cond(rad1, rad2, r_a1, r_a2, l1, l2): +231 +232 +233 +234def compute_coupling_cond(rad1, rad2, r_a1, r_a2, l1, l2): """Return the coupling conductance between two compartments. Equations taken from `https://en.wikipedia.org/wiki/Compartmental_neuron_models`. @@ -1422,10 +1422,7 @@ Source code in jaxley/utils/cell_utils.py - 234 -235 -236 -237 + 237 238 239 240 @@ -1442,7 +1439,10 @@ 251 252 253 -254def compute_coupling_cond_branchpoint(rad, r_a, l): +254 +255 +256 +257def compute_coupling_cond_branchpoint(rad, r_a, l): r"""Return the coupling conductance between one compartment and a comp with l=0. From https://en.wikipedia.org/wiki/Compartmental_neuron_models @@ -1493,10 +1493,7 @@ Source code in jaxley/utils/cell_utils.py - 257 -258 -259 -260 + 260 261 262 263 @@ -1505,7 +1502,10 @@ 266 267 268 -269def compute_impact_on_node(rad, r_a, l): +269 +270 +271 +272def compute_impact_on_node(rad, r_a, l): r"""Compute the weight with which a compartment influences its node. In order to satisfy Kirchhoffs current law, the current at a branch point must be @@ -1542,10 +1542,7 @@ Source code in jaxley/utils/cell_utils.py - 352 -353 -354 -355 + 355 356 357 358 @@ -1560,7 +1557,10 @@ 367 368 369 -370def compute_morphology_indices_in_levels( +370 +371 +372 +373def compute_morphology_indices_in_levels( num_branchpoints, child_belongs_to_branchpoint, par_inds, @@ -1665,10 +1665,7 @@ Source code in jaxley/utils/cell_utils.py - 313 -314 -315 -316 + 316 317 318 319 @@ -1682,7 +1679,10 @@ 327 328 329 -330def convert_point_process_to_distributed( +330 +331 +332 +333def convert_point_process_to_distributed( current: jnp.ndarray, radius: jnp.ndarray, length: jnp.ndarray ) -> jnp.ndarray: """Convert current point process (nA) to distributed current (uA/cm2). @@ -1754,15 +1754,15 @@ Source code in jaxley/utils/cell_utils.py - 10 -11 -12 -13 + 13 14 15 16 17 -18def equal_segments(branch_property: list, nseg_per_branch: int): +18 +19 +20 +21def equal_segments(branch_property: list, nseg_per_branch: int): """Generates segments where some property is the same in each segment. Args: @@ -1794,10 +1794,7 @@ Source code in jaxley/utils/cell_utils.py - 177 -178 -179 -180 + 180 181 182 183 @@ -1807,7 +1804,10 @@ 187 188 189 -190def get_num_neighbours( +190 +191 +192 +193def get_num_neighbours( num_children: jnp.ndarray, nseg_per_branch: int, num_branches: int, @@ -1846,10 +1846,7 @@ Source code in jaxley/utils/cell_utils.py - 373 -374 -375 -376 + 376 377 378 379 @@ -1863,7 +1860,10 @@ 387 388 389 -390def group_and_sum( +390 +391 +392 +393def group_and_sum( values_to_sum: jnp.ndarray, inds_to_group_by: jnp.ndarray, num_branchpoints: int ) -> jnp.ndarray: """Group values by whether they have the same integer and sum values within group. @@ -1988,10 +1988,7 @@ Source code in jaxley/utils/cell_utils.py - 193 -194 -195 -196 +
jaxley/utils/cell_utils.py
161 -162 -163 -164 + 164 165 166 167 @@ -1324,7 +1321,10 @@ 171 172 173 -174def compute_children_indices(parents) -> List[jnp.ndarray]: +174 +175 +176 +177def compute_children_indices(parents) -> List[jnp.ndarray]: """Return all children indices of every branch. Example: @@ -1366,10 +1366,7 @@ Source code in jaxley/utils/cell_utils.py - 220 -221 -222 -223 + 223 224 225 226 @@ -1377,7 +1374,10 @@ 228 229 230 -231def compute_coupling_cond(rad1, rad2, r_a1, r_a2, l1, l2): +231 +232 +233 +234def compute_coupling_cond(rad1, rad2, r_a1, r_a2, l1, l2): """Return the coupling conductance between two compartments. Equations taken from `https://en.wikipedia.org/wiki/Compartmental_neuron_models`. @@ -1422,10 +1422,7 @@ Source code in jaxley/utils/cell_utils.py - 234 -235 -236 -237 + 237 238 239 240 @@ -1442,7 +1439,10 @@ 251 252 253 -254def compute_coupling_cond_branchpoint(rad, r_a, l): +254 +255 +256 +257def compute_coupling_cond_branchpoint(rad, r_a, l): r"""Return the coupling conductance between one compartment and a comp with l=0. From https://en.wikipedia.org/wiki/Compartmental_neuron_models @@ -1493,10 +1493,7 @@ Source code in jaxley/utils/cell_utils.py - 257 -258 -259 -260 + 260 261 262 263 @@ -1505,7 +1502,10 @@ 266 267 268 -269def compute_impact_on_node(rad, r_a, l): +269 +270 +271 +272def compute_impact_on_node(rad, r_a, l): r"""Compute the weight with which a compartment influences its node. In order to satisfy Kirchhoffs current law, the current at a branch point must be @@ -1542,10 +1542,7 @@ Source code in jaxley/utils/cell_utils.py - 352 -353 -354 -355 + 355 356 357 358 @@ -1560,7 +1557,10 @@ 367 368 369 -370def compute_morphology_indices_in_levels( +370 +371 +372 +373def compute_morphology_indices_in_levels( num_branchpoints, child_belongs_to_branchpoint, par_inds, @@ -1665,10 +1665,7 @@ Source code in jaxley/utils/cell_utils.py - 313 -314 -315 -316 + 316 317 318 319 @@ -1682,7 +1679,10 @@ 327 328 329 -330def convert_point_process_to_distributed( +330 +331 +332 +333def convert_point_process_to_distributed( current: jnp.ndarray, radius: jnp.ndarray, length: jnp.ndarray ) -> jnp.ndarray: """Convert current point process (nA) to distributed current (uA/cm2). @@ -1754,15 +1754,15 @@ Source code in jaxley/utils/cell_utils.py - 10 -11 -12 -13 + 13 14 15 16 17 -18def equal_segments(branch_property: list, nseg_per_branch: int): +18 +19 +20 +21def equal_segments(branch_property: list, nseg_per_branch: int): """Generates segments where some property is the same in each segment. Args: @@ -1794,10 +1794,7 @@ Source code in jaxley/utils/cell_utils.py - 177 -178 -179 -180 + 180 181 182 183 @@ -1807,7 +1804,10 @@ 187 188 189 -190def get_num_neighbours( +190 +191 +192 +193def get_num_neighbours( num_children: jnp.ndarray, nseg_per_branch: int, num_branches: int, @@ -1846,10 +1846,7 @@ Source code in jaxley/utils/cell_utils.py - 373 -374 -375 -376 + 376 377 378 379 @@ -1863,7 +1860,10 @@ 387 388 389 -390def group_and_sum( +390 +391 +392 +393def group_and_sum( values_to_sum: jnp.ndarray, inds_to_group_by: jnp.ndarray, num_branchpoints: int ) -> jnp.ndarray: """Group values by whether they have the same integer and sum values within group. @@ -1988,10 +1988,7 @@ Source code in jaxley/utils/cell_utils.py - 193 -194 -195 -196 +
164 165 166 167 @@ -1324,7 +1321,10 @@ 171 172 173 -174
def compute_children_indices(parents) -> List[jnp.ndarray]: +174 +175 +176 +177
def compute_children_indices(parents) -> List[jnp.ndarray]: """Return all children indices of every branch. Example: @@ -1366,10 +1366,7 @@ Source code in jaxley/utils/cell_utils.py - 220 -221 -222 -223 + 223 224 225 226 @@ -1377,7 +1374,10 @@ 228 229 230 -231def compute_coupling_cond(rad1, rad2, r_a1, r_a2, l1, l2): +231 +232 +233 +234def compute_coupling_cond(rad1, rad2, r_a1, r_a2, l1, l2): """Return the coupling conductance between two compartments. Equations taken from `https://en.wikipedia.org/wiki/Compartmental_neuron_models`. @@ -1422,10 +1422,7 @@ Source code in jaxley/utils/cell_utils.py - 234 -235 -236 -237 + 237 238 239 240 @@ -1442,7 +1439,10 @@ 251 252 253 -254def compute_coupling_cond_branchpoint(rad, r_a, l): +254 +255 +256 +257def compute_coupling_cond_branchpoint(rad, r_a, l): r"""Return the coupling conductance between one compartment and a comp with l=0. From https://en.wikipedia.org/wiki/Compartmental_neuron_models @@ -1493,10 +1493,7 @@ Source code in jaxley/utils/cell_utils.py - 257 -258 -259 -260 + 260 261 262 263 @@ -1505,7 +1502,10 @@ 266 267 268 -269def compute_impact_on_node(rad, r_a, l): +269 +270 +271 +272def compute_impact_on_node(rad, r_a, l): r"""Compute the weight with which a compartment influences its node. In order to satisfy Kirchhoffs current law, the current at a branch point must be @@ -1542,10 +1542,7 @@ Source code in jaxley/utils/cell_utils.py - 352 -353 -354 -355 + 355 356 357 358 @@ -1560,7 +1557,10 @@ 367 368 369 -370def compute_morphology_indices_in_levels( +370 +371 +372 +373def compute_morphology_indices_in_levels( num_branchpoints, child_belongs_to_branchpoint, par_inds, @@ -1665,10 +1665,7 @@ Source code in jaxley/utils/cell_utils.py - 313 -314 -315 -316 + 316 317 318 319 @@ -1682,7 +1679,10 @@ 327 328 329 -330def convert_point_process_to_distributed( +330 +331 +332 +333def convert_point_process_to_distributed( current: jnp.ndarray, radius: jnp.ndarray, length: jnp.ndarray ) -> jnp.ndarray: """Convert current point process (nA) to distributed current (uA/cm2). @@ -1754,15 +1754,15 @@ Source code in jaxley/utils/cell_utils.py - 10 -11 -12 -13 + 13 14 15 16 17 -18def equal_segments(branch_property: list, nseg_per_branch: int): +18 +19 +20 +21def equal_segments(branch_property: list, nseg_per_branch: int): """Generates segments where some property is the same in each segment. Args: @@ -1794,10 +1794,7 @@ Source code in jaxley/utils/cell_utils.py - 177 -178 -179 -180 + 180 181 182 183 @@ -1807,7 +1804,10 @@ 187 188 189 -190def get_num_neighbours( +190 +191 +192 +193def get_num_neighbours( num_children: jnp.ndarray, nseg_per_branch: int, num_branches: int, @@ -1846,10 +1846,7 @@ Source code in jaxley/utils/cell_utils.py - 373 -374 -375 -376 + 376 377 378 379 @@ -1863,7 +1860,10 @@ 387 388 389 -390def group_and_sum( +390 +391 +392 +393def group_and_sum( values_to_sum: jnp.ndarray, inds_to_group_by: jnp.ndarray, num_branchpoints: int ) -> jnp.ndarray: """Group values by whether they have the same integer and sum values within group. @@ -1988,10 +1988,7 @@ Source code in jaxley/utils/cell_utils.py - 193 -194 -195 -196 +
220 -221 -222 -223 + 223 224 225 226 @@ -1377,7 +1374,10 @@ 228 229 230 -231def compute_coupling_cond(rad1, rad2, r_a1, r_a2, l1, l2): +231 +232 +233 +234def compute_coupling_cond(rad1, rad2, r_a1, r_a2, l1, l2): """Return the coupling conductance between two compartments. Equations taken from `https://en.wikipedia.org/wiki/Compartmental_neuron_models`. @@ -1422,10 +1422,7 @@ Source code in jaxley/utils/cell_utils.py - 234 -235 -236 -237 + 237 238 239 240 @@ -1442,7 +1439,10 @@ 251 252 253 -254def compute_coupling_cond_branchpoint(rad, r_a, l): +254 +255 +256 +257def compute_coupling_cond_branchpoint(rad, r_a, l): r"""Return the coupling conductance between one compartment and a comp with l=0. From https://en.wikipedia.org/wiki/Compartmental_neuron_models @@ -1493,10 +1493,7 @@ Source code in jaxley/utils/cell_utils.py - 257 -258 -259 -260 + 260 261 262 263 @@ -1505,7 +1502,10 @@ 266 267 268 -269def compute_impact_on_node(rad, r_a, l): +269 +270 +271 +272def compute_impact_on_node(rad, r_a, l): r"""Compute the weight with which a compartment influences its node. In order to satisfy Kirchhoffs current law, the current at a branch point must be @@ -1542,10 +1542,7 @@ Source code in jaxley/utils/cell_utils.py - 352 -353 -354 -355 + 355 356 357 358 @@ -1560,7 +1557,10 @@ 367 368 369 -370def compute_morphology_indices_in_levels( +370 +371 +372 +373def compute_morphology_indices_in_levels( num_branchpoints, child_belongs_to_branchpoint, par_inds, @@ -1665,10 +1665,7 @@ Source code in jaxley/utils/cell_utils.py - 313 -314 -315 -316 + 316 317 318 319 @@ -1682,7 +1679,10 @@ 327 328 329 -330def convert_point_process_to_distributed( +330 +331 +332 +333def convert_point_process_to_distributed( current: jnp.ndarray, radius: jnp.ndarray, length: jnp.ndarray ) -> jnp.ndarray: """Convert current point process (nA) to distributed current (uA/cm2). @@ -1754,15 +1754,15 @@ Source code in jaxley/utils/cell_utils.py - 10 -11 -12 -13 + 13 14 15 16 17 -18def equal_segments(branch_property: list, nseg_per_branch: int): +18 +19 +20 +21def equal_segments(branch_property: list, nseg_per_branch: int): """Generates segments where some property is the same in each segment. Args: @@ -1794,10 +1794,7 @@ Source code in jaxley/utils/cell_utils.py - 177 -178 -179 -180 + 180 181 182 183 @@ -1807,7 +1804,10 @@ 187 188 189 -190def get_num_neighbours( +190 +191 +192 +193def get_num_neighbours( num_children: jnp.ndarray, nseg_per_branch: int, num_branches: int, @@ -1846,10 +1846,7 @@ Source code in jaxley/utils/cell_utils.py - 373 -374 -375 -376 + 376 377 378 379 @@ -1863,7 +1860,10 @@ 387 388 389 -390def group_and_sum( +390 +391 +392 +393def group_and_sum( values_to_sum: jnp.ndarray, inds_to_group_by: jnp.ndarray, num_branchpoints: int ) -> jnp.ndarray: """Group values by whether they have the same integer and sum values within group. @@ -1988,10 +1988,7 @@ Source code in jaxley/utils/cell_utils.py - 193 -194 -195 -196 +
223 224 225 226 @@ -1377,7 +1374,10 @@ 228 229 230 -231
def compute_coupling_cond(rad1, rad2, r_a1, r_a2, l1, l2): +231 +232 +233 +234
def compute_coupling_cond(rad1, rad2, r_a1, r_a2, l1, l2): """Return the coupling conductance between two compartments. Equations taken from `https://en.wikipedia.org/wiki/Compartmental_neuron_models`. @@ -1422,10 +1422,7 @@ Source code in jaxley/utils/cell_utils.py - 234 -235 -236 -237 + 237 238 239 240 @@ -1442,7 +1439,10 @@ 251 252 253 -254def compute_coupling_cond_branchpoint(rad, r_a, l): +254 +255 +256 +257def compute_coupling_cond_branchpoint(rad, r_a, l): r"""Return the coupling conductance between one compartment and a comp with l=0. From https://en.wikipedia.org/wiki/Compartmental_neuron_models @@ -1493,10 +1493,7 @@ Source code in jaxley/utils/cell_utils.py - 257 -258 -259 -260 + 260 261 262 263 @@ -1505,7 +1502,10 @@ 266 267 268 -269def compute_impact_on_node(rad, r_a, l): +269 +270 +271 +272def compute_impact_on_node(rad, r_a, l): r"""Compute the weight with which a compartment influences its node. In order to satisfy Kirchhoffs current law, the current at a branch point must be @@ -1542,10 +1542,7 @@ Source code in jaxley/utils/cell_utils.py - 352 -353 -354 -355 + 355 356 357 358 @@ -1560,7 +1557,10 @@ 367 368 369 -370def compute_morphology_indices_in_levels( +370 +371 +372 +373def compute_morphology_indices_in_levels( num_branchpoints, child_belongs_to_branchpoint, par_inds, @@ -1665,10 +1665,7 @@ Source code in jaxley/utils/cell_utils.py - 313 -314 -315 -316 + 316 317 318 319 @@ -1682,7 +1679,10 @@ 327 328 329 -330def convert_point_process_to_distributed( +330 +331 +332 +333def convert_point_process_to_distributed( current: jnp.ndarray, radius: jnp.ndarray, length: jnp.ndarray ) -> jnp.ndarray: """Convert current point process (nA) to distributed current (uA/cm2). @@ -1754,15 +1754,15 @@ Source code in jaxley/utils/cell_utils.py - 10 -11 -12 -13 + 13 14 15 16 17 -18def equal_segments(branch_property: list, nseg_per_branch: int): +18 +19 +20 +21def equal_segments(branch_property: list, nseg_per_branch: int): """Generates segments where some property is the same in each segment. Args: @@ -1794,10 +1794,7 @@ Source code in jaxley/utils/cell_utils.py - 177 -178 -179 -180 + 180 181 182 183 @@ -1807,7 +1804,10 @@ 187 188 189 -190def get_num_neighbours( +190 +191 +192 +193def get_num_neighbours( num_children: jnp.ndarray, nseg_per_branch: int, num_branches: int, @@ -1846,10 +1846,7 @@ Source code in jaxley/utils/cell_utils.py - 373 -374 -375 -376 + 376 377 378 379 @@ -1863,7 +1860,10 @@ 387 388 389 -390def group_and_sum( +390 +391 +392 +393def group_and_sum( values_to_sum: jnp.ndarray, inds_to_group_by: jnp.ndarray, num_branchpoints: int ) -> jnp.ndarray: """Group values by whether they have the same integer and sum values within group. @@ -1988,10 +1988,7 @@ Source code in jaxley/utils/cell_utils.py - 193 -194 -195 -196 +
234 -235 -236 -237 + 237 238 239 240 @@ -1442,7 +1439,10 @@ 251 252 253 -254def compute_coupling_cond_branchpoint(rad, r_a, l): +254 +255 +256 +257def compute_coupling_cond_branchpoint(rad, r_a, l): r"""Return the coupling conductance between one compartment and a comp with l=0. From https://en.wikipedia.org/wiki/Compartmental_neuron_models @@ -1493,10 +1493,7 @@ Source code in jaxley/utils/cell_utils.py - 257 -258 -259 -260 + 260 261 262 263 @@ -1505,7 +1502,10 @@ 266 267 268 -269def compute_impact_on_node(rad, r_a, l): +269 +270 +271 +272def compute_impact_on_node(rad, r_a, l): r"""Compute the weight with which a compartment influences its node. In order to satisfy Kirchhoffs current law, the current at a branch point must be @@ -1542,10 +1542,7 @@ Source code in jaxley/utils/cell_utils.py - 352 -353 -354 -355 + 355 356 357 358 @@ -1560,7 +1557,10 @@ 367 368 369 -370def compute_morphology_indices_in_levels( +370 +371 +372 +373def compute_morphology_indices_in_levels( num_branchpoints, child_belongs_to_branchpoint, par_inds, @@ -1665,10 +1665,7 @@ Source code in jaxley/utils/cell_utils.py - 313 -314 -315 -316 + 316 317 318 319 @@ -1682,7 +1679,10 @@ 327 328 329 -330def convert_point_process_to_distributed( +330 +331 +332 +333def convert_point_process_to_distributed( current: jnp.ndarray, radius: jnp.ndarray, length: jnp.ndarray ) -> jnp.ndarray: """Convert current point process (nA) to distributed current (uA/cm2). @@ -1754,15 +1754,15 @@ Source code in jaxley/utils/cell_utils.py - 10 -11 -12 -13 + 13 14 15 16 17 -18def equal_segments(branch_property: list, nseg_per_branch: int): +18 +19 +20 +21def equal_segments(branch_property: list, nseg_per_branch: int): """Generates segments where some property is the same in each segment. Args: @@ -1794,10 +1794,7 @@ Source code in jaxley/utils/cell_utils.py - 177 -178 -179 -180 + 180 181 182 183 @@ -1807,7 +1804,10 @@ 187 188 189 -190def get_num_neighbours( +190 +191 +192 +193def get_num_neighbours( num_children: jnp.ndarray, nseg_per_branch: int, num_branches: int, @@ -1846,10 +1846,7 @@ Source code in jaxley/utils/cell_utils.py - 373 -374 -375 -376 + 376 377 378 379 @@ -1863,7 +1860,10 @@ 387 388 389 -390def group_and_sum( +390 +391 +392 +393def group_and_sum( values_to_sum: jnp.ndarray, inds_to_group_by: jnp.ndarray, num_branchpoints: int ) -> jnp.ndarray: """Group values by whether they have the same integer and sum values within group. @@ -1988,10 +1988,7 @@ Source code in jaxley/utils/cell_utils.py - 193 -194 -195 -196 +
237 238 239 240 @@ -1442,7 +1439,10 @@ 251 252 253 -254
def compute_coupling_cond_branchpoint(rad, r_a, l): +254 +255 +256 +257
def compute_coupling_cond_branchpoint(rad, r_a, l): r"""Return the coupling conductance between one compartment and a comp with l=0. From https://en.wikipedia.org/wiki/Compartmental_neuron_models @@ -1493,10 +1493,7 @@ Source code in jaxley/utils/cell_utils.py - 257 -258 -259 -260 + 260 261 262 263 @@ -1505,7 +1502,10 @@ 266 267 268 -269def compute_impact_on_node(rad, r_a, l): +269 +270 +271 +272def compute_impact_on_node(rad, r_a, l): r"""Compute the weight with which a compartment influences its node. In order to satisfy Kirchhoffs current law, the current at a branch point must be @@ -1542,10 +1542,7 @@ Source code in jaxley/utils/cell_utils.py - 352 -353 -354 -355 + 355 356 357 358 @@ -1560,7 +1557,10 @@ 367 368 369 -370def compute_morphology_indices_in_levels( +370 +371 +372 +373def compute_morphology_indices_in_levels( num_branchpoints, child_belongs_to_branchpoint, par_inds, @@ -1665,10 +1665,7 @@ Source code in jaxley/utils/cell_utils.py - 313 -314 -315 -316 + 316 317 318 319 @@ -1682,7 +1679,10 @@ 327 328 329 -330def convert_point_process_to_distributed( +330 +331 +332 +333def convert_point_process_to_distributed( current: jnp.ndarray, radius: jnp.ndarray, length: jnp.ndarray ) -> jnp.ndarray: """Convert current point process (nA) to distributed current (uA/cm2). @@ -1754,15 +1754,15 @@ Source code in jaxley/utils/cell_utils.py - 10 -11 -12 -13 + 13 14 15 16 17 -18def equal_segments(branch_property: list, nseg_per_branch: int): +18 +19 +20 +21def equal_segments(branch_property: list, nseg_per_branch: int): """Generates segments where some property is the same in each segment. Args: @@ -1794,10 +1794,7 @@ Source code in jaxley/utils/cell_utils.py - 177 -178 -179 -180 + 180 181 182 183 @@ -1807,7 +1804,10 @@ 187 188 189 -190def get_num_neighbours( +190 +191 +192 +193def get_num_neighbours( num_children: jnp.ndarray, nseg_per_branch: int, num_branches: int, @@ -1846,10 +1846,7 @@ Source code in jaxley/utils/cell_utils.py - 373 -374 -375 -376 + 376 377 378 379 @@ -1863,7 +1860,10 @@ 387 388 389 -390def group_and_sum( +390 +391 +392 +393def group_and_sum( values_to_sum: jnp.ndarray, inds_to_group_by: jnp.ndarray, num_branchpoints: int ) -> jnp.ndarray: """Group values by whether they have the same integer and sum values within group. @@ -1988,10 +1988,7 @@ Source code in jaxley/utils/cell_utils.py - 193 -194 -195 -196 +
257 -258 -259 -260 + 260 261 262 263 @@ -1505,7 +1502,10 @@ 266 267 268 -269def compute_impact_on_node(rad, r_a, l): +269 +270 +271 +272def compute_impact_on_node(rad, r_a, l): r"""Compute the weight with which a compartment influences its node. In order to satisfy Kirchhoffs current law, the current at a branch point must be @@ -1542,10 +1542,7 @@ Source code in jaxley/utils/cell_utils.py - 352 -353 -354 -355 + 355 356 357 358 @@ -1560,7 +1557,10 @@ 367 368 369 -370def compute_morphology_indices_in_levels( +370 +371 +372 +373def compute_morphology_indices_in_levels( num_branchpoints, child_belongs_to_branchpoint, par_inds, @@ -1665,10 +1665,7 @@ Source code in jaxley/utils/cell_utils.py - 313 -314 -315 -316 + 316 317 318 319 @@ -1682,7 +1679,10 @@ 327 328 329 -330def convert_point_process_to_distributed( +330 +331 +332 +333def convert_point_process_to_distributed( current: jnp.ndarray, radius: jnp.ndarray, length: jnp.ndarray ) -> jnp.ndarray: """Convert current point process (nA) to distributed current (uA/cm2). @@ -1754,15 +1754,15 @@ Source code in jaxley/utils/cell_utils.py - 10 -11 -12 -13 + 13 14 15 16 17 -18def equal_segments(branch_property: list, nseg_per_branch: int): +18 +19 +20 +21def equal_segments(branch_property: list, nseg_per_branch: int): """Generates segments where some property is the same in each segment. Args: @@ -1794,10 +1794,7 @@ Source code in jaxley/utils/cell_utils.py - 177 -178 -179 -180 + 180 181 182 183 @@ -1807,7 +1804,10 @@ 187 188 189 -190def get_num_neighbours( +190 +191 +192 +193def get_num_neighbours( num_children: jnp.ndarray, nseg_per_branch: int, num_branches: int, @@ -1846,10 +1846,7 @@ Source code in jaxley/utils/cell_utils.py - 373 -374 -375 -376 + 376 377 378 379 @@ -1863,7 +1860,10 @@ 387 388 389 -390def group_and_sum( +390 +391 +392 +393def group_and_sum( values_to_sum: jnp.ndarray, inds_to_group_by: jnp.ndarray, num_branchpoints: int ) -> jnp.ndarray: """Group values by whether they have the same integer and sum values within group. @@ -1988,10 +1988,7 @@ Source code in jaxley/utils/cell_utils.py - 193 -194 -195 -196 +
260 261 262 263 @@ -1505,7 +1502,10 @@ 266 267 268 -269
def compute_impact_on_node(rad, r_a, l): +269 +270 +271 +272
def compute_impact_on_node(rad, r_a, l): r"""Compute the weight with which a compartment influences its node. In order to satisfy Kirchhoffs current law, the current at a branch point must be @@ -1542,10 +1542,7 @@ Source code in jaxley/utils/cell_utils.py - 352 -353 -354 -355 + 355 356 357 358 @@ -1560,7 +1557,10 @@ 367 368 369 -370def compute_morphology_indices_in_levels( +370 +371 +372 +373def compute_morphology_indices_in_levels( num_branchpoints, child_belongs_to_branchpoint, par_inds, @@ -1665,10 +1665,7 @@ Source code in jaxley/utils/cell_utils.py - 313 -314 -315 -316 + 316 317 318 319 @@ -1682,7 +1679,10 @@ 327 328 329 -330def convert_point_process_to_distributed( +330 +331 +332 +333def convert_point_process_to_distributed( current: jnp.ndarray, radius: jnp.ndarray, length: jnp.ndarray ) -> jnp.ndarray: """Convert current point process (nA) to distributed current (uA/cm2). @@ -1754,15 +1754,15 @@ Source code in jaxley/utils/cell_utils.py - 10 -11 -12 -13 + 13 14 15 16 17 -18def equal_segments(branch_property: list, nseg_per_branch: int): +18 +19 +20 +21def equal_segments(branch_property: list, nseg_per_branch: int): """Generates segments where some property is the same in each segment. Args: @@ -1794,10 +1794,7 @@ Source code in jaxley/utils/cell_utils.py - 177 -178 -179 -180 + 180 181 182 183 @@ -1807,7 +1804,10 @@ 187 188 189 -190def get_num_neighbours( +190 +191 +192 +193def get_num_neighbours( num_children: jnp.ndarray, nseg_per_branch: int, num_branches: int, @@ -1846,10 +1846,7 @@ Source code in jaxley/utils/cell_utils.py - 373 -374 -375 -376 + 376 377 378 379 @@ -1863,7 +1860,10 @@ 387 388 389 -390def group_and_sum( +390 +391 +392 +393def group_and_sum( values_to_sum: jnp.ndarray, inds_to_group_by: jnp.ndarray, num_branchpoints: int ) -> jnp.ndarray: """Group values by whether they have the same integer and sum values within group. @@ -1988,10 +1988,7 @@ Source code in jaxley/utils/cell_utils.py - 193 -194 -195 -196 +
352 -353 -354 -355 + 355 356 357 358 @@ -1560,7 +1557,10 @@ 367 368 369 -370def compute_morphology_indices_in_levels( +370 +371 +372 +373def compute_morphology_indices_in_levels( num_branchpoints, child_belongs_to_branchpoint, par_inds, @@ -1665,10 +1665,7 @@ Source code in jaxley/utils/cell_utils.py - 313 -314 -315 -316 + 316 317 318 319 @@ -1682,7 +1679,10 @@ 327 328 329 -330def convert_point_process_to_distributed( +330 +331 +332 +333def convert_point_process_to_distributed( current: jnp.ndarray, radius: jnp.ndarray, length: jnp.ndarray ) -> jnp.ndarray: """Convert current point process (nA) to distributed current (uA/cm2). @@ -1754,15 +1754,15 @@ Source code in jaxley/utils/cell_utils.py - 10 -11 -12 -13 + 13 14 15 16 17 -18def equal_segments(branch_property: list, nseg_per_branch: int): +18 +19 +20 +21def equal_segments(branch_property: list, nseg_per_branch: int): """Generates segments where some property is the same in each segment. Args: @@ -1794,10 +1794,7 @@ Source code in jaxley/utils/cell_utils.py - 177 -178 -179 -180 + 180 181 182 183 @@ -1807,7 +1804,10 @@ 187 188 189 -190def get_num_neighbours( +190 +191 +192 +193def get_num_neighbours( num_children: jnp.ndarray, nseg_per_branch: int, num_branches: int, @@ -1846,10 +1846,7 @@ Source code in jaxley/utils/cell_utils.py - 373 -374 -375 -376 + 376 377 378 379 @@ -1863,7 +1860,10 @@ 387 388 389 -390def group_and_sum( +390 +391 +392 +393def group_and_sum( values_to_sum: jnp.ndarray, inds_to_group_by: jnp.ndarray, num_branchpoints: int ) -> jnp.ndarray: """Group values by whether they have the same integer and sum values within group. @@ -1988,10 +1988,7 @@ Source code in jaxley/utils/cell_utils.py - 193 -194 -195 -196 +
355 356 357 358 @@ -1560,7 +1557,10 @@ 367 368 369 -370
def compute_morphology_indices_in_levels( +370 +371 +372 +373
def compute_morphology_indices_in_levels( num_branchpoints, child_belongs_to_branchpoint, par_inds, @@ -1665,10 +1665,7 @@ Source code in jaxley/utils/cell_utils.py - 313 -314 -315 -316 + 316 317 318 319 @@ -1682,7 +1679,10 @@ 327 328 329 -330def convert_point_process_to_distributed( +330 +331 +332 +333def convert_point_process_to_distributed( current: jnp.ndarray, radius: jnp.ndarray, length: jnp.ndarray ) -> jnp.ndarray: """Convert current point process (nA) to distributed current (uA/cm2). @@ -1754,15 +1754,15 @@ Source code in jaxley/utils/cell_utils.py - 10 -11 -12 -13 + 13 14 15 16 17 -18def equal_segments(branch_property: list, nseg_per_branch: int): +18 +19 +20 +21def equal_segments(branch_property: list, nseg_per_branch: int): """Generates segments where some property is the same in each segment. Args: @@ -1794,10 +1794,7 @@ Source code in jaxley/utils/cell_utils.py - 177 -178 -179 -180 + 180 181 182 183 @@ -1807,7 +1804,10 @@ 187 188 189 -190def get_num_neighbours( +190 +191 +192 +193def get_num_neighbours( num_children: jnp.ndarray, nseg_per_branch: int, num_branches: int, @@ -1846,10 +1846,7 @@ Source code in jaxley/utils/cell_utils.py - 373 -374 -375 -376 + 376 377 378 379 @@ -1863,7 +1860,10 @@ 387 388 389 -390def group_and_sum( +390 +391 +392 +393def group_and_sum( values_to_sum: jnp.ndarray, inds_to_group_by: jnp.ndarray, num_branchpoints: int ) -> jnp.ndarray: """Group values by whether they have the same integer and sum values within group. @@ -1988,10 +1988,7 @@ Source code in jaxley/utils/cell_utils.py - 193 -194 -195 -196 +
313 -314 -315 -316 + 316 317 318 319 @@ -1682,7 +1679,10 @@ 327 328 329 -330def convert_point_process_to_distributed( +330 +331 +332 +333def convert_point_process_to_distributed( current: jnp.ndarray, radius: jnp.ndarray, length: jnp.ndarray ) -> jnp.ndarray: """Convert current point process (nA) to distributed current (uA/cm2). @@ -1754,15 +1754,15 @@ Source code in jaxley/utils/cell_utils.py - 10 -11 -12 -13 + 13 14 15 16 17 -18def equal_segments(branch_property: list, nseg_per_branch: int): +18 +19 +20 +21def equal_segments(branch_property: list, nseg_per_branch: int): """Generates segments where some property is the same in each segment. Args: @@ -1794,10 +1794,7 @@ Source code in jaxley/utils/cell_utils.py - 177 -178 -179 -180 + 180 181 182 183 @@ -1807,7 +1804,10 @@ 187 188 189 -190def get_num_neighbours( +190 +191 +192 +193def get_num_neighbours( num_children: jnp.ndarray, nseg_per_branch: int, num_branches: int, @@ -1846,10 +1846,7 @@ Source code in jaxley/utils/cell_utils.py - 373 -374 -375 -376 + 376 377 378 379 @@ -1863,7 +1860,10 @@ 387 388 389 -390def group_and_sum( +390 +391 +392 +393def group_and_sum( values_to_sum: jnp.ndarray, inds_to_group_by: jnp.ndarray, num_branchpoints: int ) -> jnp.ndarray: """Group values by whether they have the same integer and sum values within group. @@ -1988,10 +1988,7 @@ Source code in jaxley/utils/cell_utils.py - 193 -194 -195 -196 +
316 317 318 319 @@ -1682,7 +1679,10 @@ 327 328 329 -330
def convert_point_process_to_distributed( +330 +331 +332 +333
def convert_point_process_to_distributed( current: jnp.ndarray, radius: jnp.ndarray, length: jnp.ndarray ) -> jnp.ndarray: """Convert current point process (nA) to distributed current (uA/cm2). @@ -1754,15 +1754,15 @@ Source code in jaxley/utils/cell_utils.py - 10 -11 -12 -13 + 13 14 15 16 17 -18def equal_segments(branch_property: list, nseg_per_branch: int): +18 +19 +20 +21def equal_segments(branch_property: list, nseg_per_branch: int): """Generates segments where some property is the same in each segment. Args: @@ -1794,10 +1794,7 @@ Source code in jaxley/utils/cell_utils.py - 177 -178 -179 -180 + 180 181 182 183 @@ -1807,7 +1804,10 @@ 187 188 189 -190def get_num_neighbours( +190 +191 +192 +193def get_num_neighbours( num_children: jnp.ndarray, nseg_per_branch: int, num_branches: int, @@ -1846,10 +1846,7 @@ Source code in jaxley/utils/cell_utils.py - 373 -374 -375 -376 + 376 377 378 379 @@ -1863,7 +1860,10 @@ 387 388 389 -390def group_and_sum( +390 +391 +392 +393def group_and_sum( values_to_sum: jnp.ndarray, inds_to_group_by: jnp.ndarray, num_branchpoints: int ) -> jnp.ndarray: """Group values by whether they have the same integer and sum values within group. @@ -1988,10 +1988,7 @@ Source code in jaxley/utils/cell_utils.py - 193 -194 -195 -196 +
10 -11 -12 -13 + 13 14 15 16 17 -18def equal_segments(branch_property: list, nseg_per_branch: int): +18 +19 +20 +21def equal_segments(branch_property: list, nseg_per_branch: int): """Generates segments where some property is the same in each segment. Args: @@ -1794,10 +1794,7 @@ Source code in jaxley/utils/cell_utils.py - 177 -178 -179 -180 + 180 181 182 183 @@ -1807,7 +1804,10 @@ 187 188 189 -190def get_num_neighbours( +190 +191 +192 +193def get_num_neighbours( num_children: jnp.ndarray, nseg_per_branch: int, num_branches: int, @@ -1846,10 +1846,7 @@ Source code in jaxley/utils/cell_utils.py - 373 -374 -375 -376 + 376 377 378 379 @@ -1863,7 +1860,10 @@ 387 388 389 -390def group_and_sum( +390 +391 +392 +393def group_and_sum( values_to_sum: jnp.ndarray, inds_to_group_by: jnp.ndarray, num_branchpoints: int ) -> jnp.ndarray: """Group values by whether they have the same integer and sum values within group. @@ -1988,10 +1988,7 @@ Source code in jaxley/utils/cell_utils.py - 193 -194 -195 -196 +
13 14 15 16 17 -18
def equal_segments(branch_property: list, nseg_per_branch: int): +18 +19 +20 +21
def equal_segments(branch_property: list, nseg_per_branch: int): """Generates segments where some property is the same in each segment. Args: @@ -1794,10 +1794,7 @@ Source code in jaxley/utils/cell_utils.py - 177 -178 -179 -180 + 180 181 182 183 @@ -1807,7 +1804,10 @@ 187 188 189 -190def get_num_neighbours( +190 +191 +192 +193def get_num_neighbours( num_children: jnp.ndarray, nseg_per_branch: int, num_branches: int, @@ -1846,10 +1846,7 @@ Source code in jaxley/utils/cell_utils.py - 373 -374 -375 -376 + 376 377 378 379 @@ -1863,7 +1860,10 @@ 387 388 389 -390def group_and_sum( +390 +391 +392 +393def group_and_sum( values_to_sum: jnp.ndarray, inds_to_group_by: jnp.ndarray, num_branchpoints: int ) -> jnp.ndarray: """Group values by whether they have the same integer and sum values within group. @@ -1988,10 +1988,7 @@ Source code in jaxley/utils/cell_utils.py - 193 -194 -195 -196 +
177 -178 -179 -180 + 180 181 182 183 @@ -1807,7 +1804,10 @@ 187 188 189 -190def get_num_neighbours( +190 +191 +192 +193def get_num_neighbours( num_children: jnp.ndarray, nseg_per_branch: int, num_branches: int, @@ -1846,10 +1846,7 @@ Source code in jaxley/utils/cell_utils.py - 373 -374 -375 -376 + 376 377 378 379 @@ -1863,7 +1860,10 @@ 387 388 389 -390def group_and_sum( +390 +391 +392 +393def group_and_sum( values_to_sum: jnp.ndarray, inds_to_group_by: jnp.ndarray, num_branchpoints: int ) -> jnp.ndarray: """Group values by whether they have the same integer and sum values within group. @@ -1988,10 +1988,7 @@ Source code in jaxley/utils/cell_utils.py - 193 -194 -195 -196 +
180 181 182 183 @@ -1807,7 +1804,10 @@ 187 188 189 -190
def get_num_neighbours( +190 +191 +192 +193
def get_num_neighbours( num_children: jnp.ndarray, nseg_per_branch: int, num_branches: int, @@ -1846,10 +1846,7 @@ Source code in jaxley/utils/cell_utils.py - 373 -374 -375 -376 + 376 377 378 379 @@ -1863,7 +1860,10 @@ 387 388 389 -390def group_and_sum( +390 +391 +392 +393def group_and_sum( values_to_sum: jnp.ndarray, inds_to_group_by: jnp.ndarray, num_branchpoints: int ) -> jnp.ndarray: """Group values by whether they have the same integer and sum values within group. @@ -1988,10 +1988,7 @@ Source code in jaxley/utils/cell_utils.py - 193 -194 -195 -196 +
373 -374 -375 -376 + 376 377 378 379 @@ -1863,7 +1860,10 @@ 387 388 389 -390def group_and_sum( +390 +391 +392 +393def group_and_sum( values_to_sum: jnp.ndarray, inds_to_group_by: jnp.ndarray, num_branchpoints: int ) -> jnp.ndarray: """Group values by whether they have the same integer and sum values within group. @@ -1988,10 +1988,7 @@ Source code in jaxley/utils/cell_utils.py - 193 -194 -195 -196 +
376 377 378 379 @@ -1863,7 +1860,10 @@ 387 388 389 -390
def group_and_sum( +390 +391 +392 +393
def group_and_sum( values_to_sum: jnp.ndarray, inds_to_group_by: jnp.ndarray, num_branchpoints: int ) -> jnp.ndarray: """Group values by whether they have the same integer and sum values within group. @@ -1988,10 +1988,7 @@ Source code in jaxley/utils/cell_utils.py - 193 -194 -195 -196 +
193 -194 -195 -196 +