ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/osprai/osprai/trunk/cal_module.py
(Generate patch)
# Line 10 | Line 10
10                    Institute for Systems Biology,
11                    OSPRAI developers.    
12  
13 < Examples::
13 > Example::
14  
15    >>> import cal_module as cal
16    >>> import io_module as io
17 <  >>> baC = io.readsprit("calibrationdata.txt")
18 <  >>> ba1 = io.readsprit("spritdata.txt")
19 <  >>> ba2 = cal.calibrate(ba1, baCal, t1, t2, n1, n2)
17 >  >>> baC = io.readicmtxt("./exampledata/example-icm.txt")
18 >  This ICM file has...
19 >  >>> ba1 = io.readicmtxt("./exampledata/example-icm.txt")
20 >  This ICM file has...
21 >  >>> t1, t2 = 1921, 2021
22 >  >>> n1, n2 = 1335700, 1336600
23 >  >>> ba2 = cal.calibrate(ba1, baC, t1, t2, n1, n2)
24 >  >>> bgroi = 2
25    >>> cal.bgset(ba2, bgroi)
26    >>> ba3 = cal.bgsubt(ba2)
27   """
28 < __version__ = "110215"
28 > __version__ = "110419"
29  
30  
31   ## Import libraries
# Line 179 | Line 184
184      return ltype(lst)
185      """End of flattenlist()"""
186  
187 +
188 + if __name__ == "__main__":
189 +    """
190 +    Code testing.  
191 +    Simply execute 'python cal_module.py'.
192 +    Doctest runs the example code in the docstrings.
193 +    Can use ellipses as wildcard for returned text.
194 +    """
195 +    import doctest
196 +    doctest.testmod(optionflags=doctest.ELLIPSIS)
197 +
198 +
199   ################################# End of module #################################

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines