Remove unnecessary use of "simply" throughout documentation

parent 9e29402b
......@@ -82,7 +82,7 @@ The amplitude function will be calculated based on the traces selected by *trace
Code commented
==============
*None* is a Python built-in constant. It is used in to represent the absence of a value. Therefore, in our example, when the argument *trace* is empty (its value is *None*) we will simply select the current trace with :func:`stf.get_trace_index()` and store it in the variable **sweep**. If not, the variable **sweep** will take the value taken by *trace*. This iscontroled by the following if-block within the function:
*None* is a Python built-in constant. It is used in to represent the absence of a value. Therefore, in our example, when the argument *trace* is empty (its value is *None*) we will select the current trace with :func:`stf.get_trace_index()` and store it in the variable **sweep**. If not, the variable **sweep** will take the value taken by *trace*. This iscontroled by the following if-block within the function:
::
......@@ -108,7 +108,7 @@ Note that after setting the stf cursors, we update the measurements in the trace
Usage
=====
The function accepts an optional *trace* argument. That means, that we do not need to declare it when using the function. In that case, the function will work on the current trace. For example, if we want to calculate the amplitude between a baseline between (500+10) msec and a peak between 750 and 760 msec on the current trace, we simply enter:
The function accepts an optional *trace* argument. That means, that we do not need to declare it when using the function. In that case, the function will work on the current trace. For example, if we want to calculate the amplitude between a baseline between (500+10) msec and a peak between 750 and 760 msec on the current trace, we enter:
::
......
......@@ -139,7 +139,7 @@ this will look for events below the value -40 but not in the current trace, only
>>> spells.count_events(threshold=-40,start=500,up=False,delta=1000,mark=False,trace=10)
If you want to create a list of events with the events found in a selection of traces, you can simply type:
If you want to create a list of events with the events found in a selection of traces, you can type:
::
......
......@@ -94,7 +94,7 @@ To make the experience more interactive, we can load the string of the file with
Usage
=====
To see how both function work simply import the spells module in the Python console of Stimfit and try the example files. For example:
To see how both function work import the spells module in the Python console of Stimfit and try the example files. For example:
::
......
......@@ -15,13 +15,13 @@ This document collects answers to some questions like "How do I make ... in `Sti
It assumes a basic knowledge of the embedded Python shell of `Stimfit <http://www.stimfit.org>`_. Some Python knowledge and a substantial proficiency in `Stimfit <http://www.stimfit.org>`_ are recommendable. Please note that this is not a Python manual, but a way to use Python for some basic analysis tasks provided with `Stimfit <http://www.stimfit.org>`_. For a detailed Python manual, we encourage the user to visit the official Python documentation on the [Python-website]_ and to read carefully the :doc:`/manual/index`.
The functions described along this document are available in your current `Stimfit <http://www.stimfit.org>`_ version. To make use of them you have simply to type the following line in the `Stimfit <http://www.stimfit.org>`_ embedded Python shell:
The functions described along this document are available in your current `Stimfit <http://www.stimfit.org>`_ version. To make use of them you have to type the following line in the `Stimfit <http://www.stimfit.org>`_ embedded Python shell:
::
>>> import spells
After that, functions can be called with the dot notation (i.e just typing **spells** before the function) For example, if we want to call the function rmean() we would simply do it in this way:
After that, functions can be called with the dot notation (i.e just typing **spells** before the function) For example, if we want to call the function rmean() we would do it in this way:
::
......
......@@ -50,7 +50,7 @@ We will start with a basic example to start using objects in the embedded Python
self.owner = owner
We can save this class in a file called test.py and import into our Python session. After importing the file, nothing will happen. This is because we simply loaded the class (i.e instructions of how to create the object), but not the object itself. Now, we can create an object called **myTrace** with the instructions described in that class as follows:
We can save this class in a file called test.py and import into our Python session. After importing the file, nothing will happen. This is because we loaded the class (i.e instructions of how to create the object), but not the object itself. Now, we can create an object called **myTrace** with the instructions described in that class as follows:
>>> myTrace= test.Trace('root') # test.py contains the class Trace()
......@@ -60,7 +60,7 @@ myTrace is now my particular object. It was created with the instructions given
Object attributes
=================
Object attributes can be accessed with the dot notation. To test the attributes of "myTrace" we simply type:
Object attributes can be accessed with the dot notation. To test the attributes of "myTrace" we type:
>>> myTrace.dt
>>> 0.05000000074505806
......@@ -79,13 +79,13 @@ As you can see bellow, nothing would prevent us to assign a new value to any of
>>> myTrace.dt = 3
This potentially very dangerous (imagine the consecuences of setting the sampling rate to 3 in further calculations). For that reason, it is a very good programming practice to hide some object attributes to the user. This is called **encapsulation**. To hide the attributes of "myTrace", we have just to insert a single underscore before the attribute in the class. These objects are **private** which simply means, "look, but do not touch!"
This potentially very dangerous (imagine the consecuences of setting the sampling rate to 3 in further calculations). For that reason, it is a very good programming practice to hide some object attributes to the user. This is called **encapsulation**. To hide the attributes of "myTrace", we have just to insert a single underscore before the attribute in the class. These objects are **private** which means, "look, but do not touch!"
.. note::
Python strongly relies on convention rather than on enforcement. For example, encapsulated attributes are not really private (i.e user can overwrite them if necessary), but the underscore notation is used to indicate internal use only. If you find a good reason to overwrite them, Python is not going to stop you. However, it is a good programming practice to keep the Python conventions if you want to share your programs with other users.
Additionally, we could give the user the opportunity to retrieve these values without the dot notation by simply creating some functions available to this object. These would be the object methods. For example, we can create 2 functions called get_sampling_interval() and get_trace_index() inside the class. These are the methods of the object.
Additionally, we could give the user the opportunity to retrieve these values without the dot notation by creating some functions available to this object. These would be the object methods. For example, we can create 2 functions called get_sampling_interval() and get_trace_index() inside the class. These are the methods of the object.
::
......@@ -173,7 +173,7 @@ As soon as we move through the recording, the trace index may change. However, i
""" get trace index """
return self._trace
After reloading this class, and creating "myTrace" we can use the update() method. This simply collects the current trace index and sampling interval. If we change the trace or even the window, we have to call update() again to retreive the current index and sampling interval.
After reloading this class, and creating "myTrace" we can use the update() method. This collects the current trace index and sampling interval. If we change the trace or even the window, we have to call update() again to retreive the current index and sampling interval.
>>> myTrace3 = test.myTrace('user')
>>> myTrace3.get_trace_index()
......@@ -189,7 +189,7 @@ After reloading this class, and creating "myTrace" we can use the update() metho
Class inheritance
=================
Object-oriented languages like Python support class inheritance. This means that we can inherit attributes and methods from a pre-existing class. Thus, we do not need to rewrite again this code. We can simply inherit from another class (called mother class).
Object-oriented languages like Python support class inheritance. This means that we can inherit attributes and methods from a pre-existing class. Thus, we do not need to rewrite again this code. We can inherit from another class (called mother class).
To inherit code from another class, we have to add the name of the mother class in the class headline. For example:
>>> class Channel(Trace):
......
......@@ -259,11 +259,11 @@ and move after that to another trace, we could calculate the difference between
the former will give the peak value when in the trace where the object was created, and the later will return the peak in the current trace.
Additionally, we can decide to change the threshold value of the AP in a trace. For that, we can simply type:
Additionally, we can decide to change the threshold value of the AP in a trace. For that, we can type:
>>> myspike(20)
And now the Spike attributes will be updated with the new threshold in the current trace. The function __call__ simply allows to call the object with a given argument, and we used it to set a different threshold and update the object attributes.
And now the Spike attributes will be updated with the new threshold in the current trace. The function __call__ allows to call the object with a given argument, and we used it to set a different threshold and update the object attributes.
=====
Usage
......@@ -300,7 +300,7 @@ Additionally, we have methods like **get_tamplitude()**, **get_threshold()** and
>>> latency = dend.t50_left - soma.t50_left
You can find the class Spike described above in your current `Stimfit <http://www.stimfit.org>`_ version. To use it, you can simply import it from the spells module with the following command;
You can find the class Spike described above in your current `Stimfit <http://www.stimfit.org>`_ version. To use it, you can import it from the spells module with the following command;
>>> from spells import Spike
>>> soma = Spike(50)
......
......@@ -5,7 +5,7 @@ Resistance Calculation
:Authors: Jose Guzman
:Updated: |today|
The resistance can be simply calculated using Ohm's law. Currents passing through the pipette will be proportional to the applied voltage difference. This proportional factor is the resistance.
The resistance can be calculated using Ohm's law. Currents passing through the pipette will be proportional to the applied voltage difference. This proportional factor is the resistance.
.. math::
......@@ -101,7 +101,7 @@ Now base_starts should be given in units of x (i.e ms). This is more intiutive i
=====
Usage
=====
Now, you can use this function for different purposes. For example, you may want to test the value of the series resistance in response to a 5 mV hyperpolarizing pulse. First, let's assume that your recording has the current peak between the 10700 and 10999 sampling points. You should set the baseline (for example between 0 and 999) and then peak between 10700 and 10999. After that, and given that 5 mV is the voltage difference, you simply type:
Now, you can use this function for different purposes. For example, you may want to test the value of the series resistance in response to a 5 mV hyperpolarizing pulse. First, let's assume that your recording has the current peak between the 10700 and 10999 sampling points. You should set the baseline (for example between 0 and 999) and then peak between 10700 and 10999. After that, and given that 5 mV is the voltage difference, you type:
>>> spells.resistance(0,999,10700,1999,-5)
......
......@@ -7,7 +7,7 @@ Running mean
The running mean (or running average) is simple way to smooth the data. Given a certain set of points, a running average will create a new set of data points which will be computed by adding a series of averages of different subsets of the full data set.
Given for example a sequence :math:`X` of :math:`n` points, we can create a new set of data points :math:`S` of length :math:`n` by simply taking the average of a subset of :math:`w` points from the original data set for every point :math:`S_i` within the set:
Given for example a sequence :math:`X` of :math:`n` points, we can create a new set of data points :math:`S` of length :math:`n` by taking the average of a subset of :math:`w` points from the original data set for every point :math:`S_i` within the set:
.. math::
......@@ -81,7 +81,7 @@ Code commented
>>> sweep = stf.get_trace(trace,channel)
:func:`stf.get_trace()` simply imports the **trace** of the **channel** into a 1D-Numpy array that we called sweep. The default values provided by the function are -1. This means that by default, the current trace/channel will be imported.
:func:`stf.get_trace()` imports the **trace** of the **channel** into a 1D-Numpy array that we called sweep. The default values provided by the function are -1. This means that by default, the current trace/channel will be imported.
We create a new stf window with the following
......@@ -95,7 +95,7 @@ where dsweep is the 1D-NumPy array obtained after performing the running averag
Usage
=====
To perform the running average of 10 sampling points of the current trace, simply type:
To perform the running average of 10 sampling points of the current trace, type:
::
......
......@@ -81,7 +81,7 @@ Optional: PyEMF
Download the Stimfit source code
================================
You can download the latest development code for `Stimfit <http://www.stimfit.org>`_ from the `Github code repository <https://github.com/neurodroid/stimfit/>`_. For that, simply type from your current $HOME directory:
You can download the latest development code for `Stimfit <http://www.stimfit.org>`_ from the `Github code repository <https://github.com/neurodroid/stimfit/>`_. For that, type from your current $HOME directory:
::
......@@ -134,7 +134,7 @@ where [N] is the number of parallel builds you want to start. And finally:
$ ./configure --prefix= $HOME/.local PYTHON = $HOME/.local/lib/python2.6 --enable-python
and after that simply call **make** and **make install** as normal user. The Stimfit executable will be now in $HOME/.local
and after that call **make** and **make install** as normal user. The Stimfit executable will be now in $HOME/.local
==========================================
Building Stimfit with BioSig import filter
......@@ -173,7 +173,7 @@ The manual of `Stimfit <http://www.stimfit.org>`_ including the documentation is
sudo apt-get install python-sphinx
It is possible to build a local copy of the documentation there by simply calling:
It is possible to build a local copy of the documentation there by calling:
::
......
......@@ -201,7 +201,7 @@ First, you have to select the traces to average (Fig. 14). Once you are done, cl
.. note::
If you want to perform an average (or any other measurement) of all traces in a recording, simply select Edit-> Select all, or type Ctrl+A
If you want to perform an average (or any other measurement) of all traces in a recording, select Edit-> Select all, or type Ctrl+A
Fitting functions to data
=========================
......
......@@ -29,7 +29,7 @@ The method described above yields reliable results when both the pre- and the po
Setting the latency cursors
===========================
Two latency cursors exist in `Stimfit <http://www.stimfit.org>`_ that are plotted as dotted vertical blue lines. Latency is simply computed as the time interval between the first and the second latency cursor. You can set the cursors manually by simply pressing the key **L** or the latency button on the toolbar (Fig. 19A).
Two latency cursors exist in `Stimfit <http://www.stimfit.org>`_ that are plotted as dotted vertical blue lines. Latency is computed as the time interval between the first and the second latency cursor. You can set the cursors manually by pressing the key **L** or the latency button on the toolbar (Fig. 19A).
.. figure:: images/latency.png
:align: center
......
......@@ -48,7 +48,7 @@ The function documentation will pop up when you type in the opening
bracket. The function returns the boolean False because you have not
opened any file yet. Since the stf module is imported in the namespace,
you can omit the initial ```stf.``` when calling functions. Thus, you
could get just the same result by simply typing
could get just the same result by typing
::
......@@ -343,7 +343,7 @@ To import and use this file, you would do:
.. note::
You can import a file from any directory by selecting **File->Import Python module** or simpy by pressing ``Ctrl+I``. The file will be automatically loaded in the embedded Python shell and ready to be used (it is not necessary to type import(myFile). To reload the file, you have simply to select **File->Import Python module** or ``Ctrl+I`` again.
You can import a file from any directory by selecting **File->Import Python module** or simpy by pressing ``Ctrl+I``. The file will be automatically loaded in the embedded Python shell and ready to be used (it is not necessary to type import(myFile). To reload the file, you have to select **File->Import Python module** or ``Ctrl+I`` again.
Add a Python function to the Stimfit menu
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment