From 04b25f508f2b8e3aedeb3cc17ce52ca097fc58ab Mon Sep 17 00:00:00 2001 From: Han Lu <11597940+ErbB4@users.noreply.github.com> Date: Wed, 31 Jul 2024 14:49:25 +0200 Subject: [PATCH 1/6] fixed typo and code style Thorsten please add the units --- doc/python/decor.rst | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/doc/python/decor.rst b/doc/python/decor.rst index 0581f29fb6..a8740a6510 100644 --- a/doc/python/decor.rst +++ b/doc/python/decor.rst @@ -7,7 +7,7 @@ Cable cell decoration .. py:class:: decor - A decor object contains a description of the cell dynamics, to be applied + A decor object contains a description of the cell dynamics to be applied to a morphology when used to instantiate a :py:class:`cable_cell` .. method:: __init__() @@ -35,9 +35,10 @@ Cable cell decoration .. code-block:: Python + import arbor as A # Set cell-wide values for properties for resistivity and capacitance - decor = arbor.decor() - decor.set_property(rL=100, cm=0.1) + decor = A.decor() + decor.set_property(rL=100 [unit], cm=0.1[unit]) .. method:: set_ion(ion, int_con=None, ext_con=None, rev_pot=None, method=None) @@ -60,8 +61,9 @@ Cable cell decoration .. code-block:: Python + import arbor as A # Set nernst reversal potential method for calcium. - ca_mech = arbor.mechanism('nernst/x=ca') + ca_mech = A.mechanism('nernst/x=ca') decor.set_ion('ca', method=ca_mech) # Set reversal potential and concentration for sodium. @@ -74,7 +76,7 @@ Cable cell decoration .. method:: paint(region, Vm=None, cm=None, rL=None, tempK=None) Set cable properties on a region. A property ``v`` is given as a float - or a string. In the latter ``v`` will be interpreted as an inhomogeneous + or a string. In the latter, ``v`` will be interpreted as an inhomogeneous expression. :param str region: description of the region. @@ -103,7 +105,7 @@ Cable cell decoration :noindex: Set ion species properties initial conditions on a region. A property - ``v`` is given as a float or a string. In the latter ``v`` will be + ``v`` is given as a float or a string. In the latter, ``v`` will be interpreted as an inhomogeneous expression. :param str name: name of the ion species. @@ -141,7 +143,7 @@ Cable cell decoration Place one instance of the gap junction mechanism described by ``junction`` at each location in ``locations`` and label the group of gap junction sites with ``label``. The label can be used to form gap junction - connections to/from one of labeled sites in the :py:class:`arbor.recipe` by creating a + connections to/from one of the labeled sites in the :py:class:`arbor.recipe` by creating a :py:class:`arbor.gap_junction_connection`. :param str locations: description of the locset. From 2f5365080796b237c8c5d34be797aa4e1815df3c Mon Sep 17 00:00:00 2001 From: Han Lu <11597940+ErbB4@users.noreply.github.com> Date: Thu, 1 Aug 2024 09:25:47 +0200 Subject: [PATCH 2/6] Update decor.rst --- doc/python/decor.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/python/decor.rst b/doc/python/decor.rst index a8740a6510..ce5dd1f200 100644 --- a/doc/python/decor.rst +++ b/doc/python/decor.rst @@ -38,7 +38,7 @@ Cable cell decoration import arbor as A # Set cell-wide values for properties for resistivity and capacitance decor = A.decor() - decor.set_property(rL=100 [unit], cm=0.1[unit]) + decor.set_property(rL=100, cm=0.1) .. method:: set_ion(ion, int_con=None, ext_con=None, rev_pot=None, method=None) From 282d4060597fb308f2c81dadae1937d4eb9eb546 Mon Sep 17 00:00:00 2001 From: Han Lu <11597940+ErbB4@users.noreply.github.com> Date: Thu, 1 Aug 2024 15:03:01 +0200 Subject: [PATCH 3/6] fixed unit --- doc/python/decor.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/python/decor.rst b/doc/python/decor.rst index ce5dd1f200..1ade2ca7f3 100644 --- a/doc/python/decor.rst +++ b/doc/python/decor.rst @@ -38,7 +38,7 @@ Cable cell decoration import arbor as A # Set cell-wide values for properties for resistivity and capacitance decor = A.decor() - decor.set_property(rL=100, cm=0.1) + decor.set_property(rL=100 * U.Ω·cm, cm=0.1 * U.F/m²) .. method:: set_ion(ion, int_con=None, ext_con=None, rev_pot=None, method=None) @@ -68,7 +68,7 @@ Cable cell decoration # Set reversal potential and concentration for sodium. # The reversal potential is fixed, so we set the method to None. - decor.set_ion('na', int_con=5.0, rev_pot=70, method=None) + decor.set_ion('na', int_con=5.0 * U.mM, rev_pot=70 * U.mV, method=None) Various specialisations of the ``paint`` method are available for setting properties and density mechanisms that are applied to regions. @@ -92,10 +92,10 @@ Cable cell decoration .. code-block:: Python # Specialize resistivity on soma - decor.paint('"soma"', rL=100) + decor.paint('"soma"', rL=100 * U.Ω·cm) # Specialize resistivity and capacitance on the axon, where # axon is defined using a region expression. - decor.paint('(tag 2)', cm=0.05, rL=80) + decor.paint('(tag 2)', cm=0.05 * U.F/m², rL=80 * U.Ω·cm) # Specialize resistivity on soma and set :math:`r_L(s) = 42.0 \cdot d(s)` # where `s` parametrises the cable segment(s) and :math:`d(s)` is the cable # diameter at `s`. From 4b20500a9d7e67523893450676043ccdc9c0f02a Mon Sep 17 00:00:00 2001 From: Han Lu <11597940+ErbB4@users.noreply.github.com> Date: Thu, 8 Aug 2024 08:57:35 +0200 Subject: [PATCH 4/6] Update doc/python/decor.rst Co-authored-by: Thorsten Hater <24411438+thorstenhater@users.noreply.github.com> --- doc/python/decor.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/python/decor.rst b/doc/python/decor.rst index 1ade2ca7f3..4f2ffba011 100644 --- a/doc/python/decor.rst +++ b/doc/python/decor.rst @@ -38,7 +38,7 @@ Cable cell decoration import arbor as A # Set cell-wide values for properties for resistivity and capacitance decor = A.decor() - decor.set_property(rL=100 * U.Ω·cm, cm=0.1 * U.F/m²) + decor.set_property(rL=100 * U.Ohm * U.cm, cm=0.1 * U.F/ U.m2) .. method:: set_ion(ion, int_con=None, ext_con=None, rev_pot=None, method=None) From e123122b19575467d87d8c2873adb8952f37a745 Mon Sep 17 00:00:00 2001 From: Han Lu <11597940+ErbB4@users.noreply.github.com> Date: Thu, 8 Aug 2024 09:33:57 +0200 Subject: [PATCH 5/6] updated unit as requested --- doc/python/decor.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/python/decor.rst b/doc/python/decor.rst index 4f2ffba011..1e30f9b038 100644 --- a/doc/python/decor.rst +++ b/doc/python/decor.rst @@ -92,10 +92,10 @@ Cable cell decoration .. code-block:: Python # Specialize resistivity on soma - decor.paint('"soma"', rL=100 * U.Ω·cm) + decor.paint('"soma"', rL=100 * * U.Ohm * U.cm) # Specialize resistivity and capacitance on the axon, where # axon is defined using a region expression. - decor.paint('(tag 2)', cm=0.05 * U.F/m², rL=80 * U.Ω·cm) + decor.paint('(tag 2)', cm=0.05 * U.F/U.m2, rL=80 * U.Ohm * U.cm) # Specialize resistivity on soma and set :math:`r_L(s) = 42.0 \cdot d(s)` # where `s` parametrises the cable segment(s) and :math:`d(s)` is the cable # diameter at `s`. From eabab9e02ad73580b26dcc685792089418431292 Mon Sep 17 00:00:00 2001 From: Han Lu <11597940+ErbB4@users.noreply.github.com> Date: Thu, 8 Aug 2024 09:35:54 +0200 Subject: [PATCH 6/6] Update decor.rst --- doc/python/decor.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/python/decor.rst b/doc/python/decor.rst index 1e30f9b038..8573fc47c4 100644 --- a/doc/python/decor.rst +++ b/doc/python/decor.rst @@ -92,7 +92,7 @@ Cable cell decoration .. code-block:: Python # Specialize resistivity on soma - decor.paint('"soma"', rL=100 * * U.Ohm * U.cm) + decor.paint('"soma"', rL=100 * U.Ohm * U.cm) # Specialize resistivity and capacitance on the axon, where # axon is defined using a region expression. decor.paint('(tag 2)', cm=0.05 * U.F/U.m2, rL=80 * U.Ohm * U.cm)