PageRenderTime 19ms CodeModel.GetById 12ms app.highlight 4ms RepoModel.GetById 1ms app.codeStats 1ms

/doc/glossary.rst

https://code.google.com/p/ruffus/
ReStructuredText | 81 lines | 48 code | 33 blank | 0 comment | 0 complexity | 93b7851be858bfe109d5fccdcacbfe51 MD5 | raw file
 1.. include:: global.inc
 2****************
 3Glossary
 4****************
 5.. _Glossary:
 6
 7.. _glossary.task:
 8
 9.. glossary::
10    
11    
12    
13    task
14        A stage in a computational pipeline.
15
16        Each **task** in *ruffus* is represented by a python function.
17    
18        For example, a task might be to find the products of a sets of two numbers::
19
20            4 x 5 = 20
21            5 x 6 = 30
22            2 x 7 = 14   
23
24    job
25        Any number of operations which can be run in parallel and make up
26        the work in a stage of a computional pipeline.
27        
28        Each **task** in *ruffus* is a separate call to the **task** function.
29        
30        For example, if a task is to find products of numbers, each of these will be a separate job.
31        
32            Job1::
33            
34                4 x 5 = 20
35            
36            Job2::
37            
38                5 x 6 = 30
39                    
40            Job3::
41            
42                2 x 7 = 14   
43            
44        Jobs need not complete in order.
45        
46    
47    decorator
48        Ruffus decorators allow functions to be incorporated into a computational
49        pipeline, with automatic generation of parameters, dependency checking etc.,
50        without modifying any code within the function.
51        Quoting from the `python wiki <http://wiki.python.org/moin/PythonDecorators>`_:
52
53            A Python decorator is a specific change to the Python syntax that 
54            allows us to more conveniently alter functions and methods.
55
56            Decorators dynamically alter the functionality of a function, method, or 
57            class without having to directly use subclasses or change the source code 
58            of the function being decorated.
59            
60
61    
62    generator
63        python generators are new to python 2.2 
64        (see `Charming Python: Iterators and simple generators <http://www.ibm.com/developerworks/library/l-pycon.html>`_).
65        They allow iterable data to be generated on the fly.
66        
67        Ruffus asks for generators when you want to generate **job** parameters dynamically.
68        
69        Each set of job parameters is returned by the ``yield`` keyword for 
70        greater clarity. For example,::
71        
72            def generate_job_parameters():
73                
74                for file_index, file_name in iterate(all_file_names):
75                
76                    # parameter for each job
77                    yield file_index, file_name
78    
79        Each job takes the parameters ``file_index`` and ``file_name``
80    
81