From 25e25a7a5b912f94369cec09a18757d924a6037b Mon Sep 17 00:00:00 2001 From: Chaoming Wang Date: Tue, 9 Jul 2024 20:20:50 +0100 Subject: [PATCH] update doc --- dendritex/_base.py | 23 +++++++++++++++++++++-- docs/apis/dendritex.neurons.rst | 15 +++++++++++++++ docs/apis/dendritex.rst | 16 +++------------- 3 files changed, 39 insertions(+), 15 deletions(-) create mode 100644 docs/apis/dendritex.neurons.rst diff --git a/dendritex/_base.py b/dendritex/_base.py index a210e5a..7b47f22 100644 --- a/dendritex/_base.py +++ b/dendritex/_base.py @@ -288,6 +288,22 @@ def add_elem(self, *elems, **elements): class IonChannel(DendriticDynamics, TreeNode): + """ + The base class for ion channel modeling. + + :py:class:`IonChannel` can be used to model the dynamics of an ion (instance of :py:class:`Ion`), or + a mixture of ions (instance of :py:class:`MixIons`), or a channel (instance of :py:class:`Channel`). + + Particularly, an implementation of a :py:class:`IonChannel` should implement the following methods: + + - :py:meth:`current`: Calculate the current of the ion channel. + - :py:meth:`before_integral`: Calculate the state variables before the integral. + - :py:meth:`compute_derivative`: Calculate the derivative of the state variables. + - :py:meth:`after_integral`: Calculate the state variables after the integral. + - :py:meth:`init_state`: Initialize the state variables. + - :py:meth:`reset_state`: Reset the state variables. + + """ __module__ = 'dentritex' def current(self, *args, **kwargs): @@ -315,7 +331,8 @@ class IonInfo(NamedTuple): class Ion(IonChannel, Container): - """The brainpy_object calcium dynamics. + """ + The base class for modeling the Ion dynamics. Args: size: The size of the simulation target. @@ -577,5 +594,7 @@ def mix_ions(*ions) -> MixIons: class Channel(IonChannel): - """Base class for ion channels.""" + """ + The base class for modeling channel dynamics. + """ __module__ = 'dentritex' diff --git a/docs/apis/dendritex.neurons.rst b/docs/apis/dendritex.neurons.rst new file mode 100644 index 0000000..e117d33 --- /dev/null +++ b/docs/apis/dendritex.neurons.rst @@ -0,0 +1,15 @@ +``dendritex.neurons`` module +============================ + +.. currentmodule:: dendritex.neurons +.. automodule:: dendritex.neurons + + +.. autosummary:: + :toctree: generated/ + :nosignatures: + :template: classtemplate.rst + + SingleCompartment + MultiCompartment + diff --git a/docs/apis/dendritex.rst b/docs/apis/dendritex.rst index d5ccf7d..1945788 100644 --- a/docs/apis/dendritex.rst +++ b/docs/apis/dendritex.rst @@ -15,24 +15,15 @@ Base Classes :template: classtemplate.rst HHTypedNeuron + State4Integral IonChannel Ion + IonInfo MixIons Channel -Helper Classes --------------- - -.. autosummary:: - :toctree: generated/ - :nosignatures: - :template: classtemplate.rst - - IonInfo - - -Integrator Methods +Integration Methods -------------------- .. autosummary:: @@ -40,7 +31,6 @@ Integrator Methods :nosignatures: :template: classtemplate.rst - State4Integral euler_step rk2_step rk3_step