Commits

Anonymous committed 06bc097

Working on getting the documentation current.

Comments (0)

Files changed (11)

 # Example configuration for intersphinx: refer to the Python standard library.
 intersphinx_mapping = {'http://docs.python.org/dev': None,
                        'http://networkx.lanl.gov/': None}
+
+autodoc_member_order = 'groupwise'

docs/ref/event.rst

+======================================
+:mod:`hornet.event` -- Events
+======================================
+
+.. testsetup:: *
+
+    from hornet.event import *
+
+.. automodule:: hornet.event
+    :members:
+    :undoc-members:
+

docs/ref/file.rst

 
 .. autofunction:: hornet.file.tmp_file
 
+.. autofunction:: hornet.file.tmp_dir
+
+.. autofunction:: hornet.file.list_dir
+
 .. autofunction:: hornet.file.remove
+
+.. autofunction:: hornet.file.join

docs/ref/index.rst

     task
     file
     db
+    event
     plot
     loading
     util

docs/ref/plugin.rst

 Decorators
 ===========
 
-.. autofunction:: hornet.plugin.logl
+.. autofunction:: hornet.plugin.log
 
 .. autofunction:: hornet.plugin.notify_on_finish
 

docs/ref/util.rst

 .. testsetup:: *
 
     from hornet.util import *
+    import datetime
 
 .. automodule:: hornet.util
     :members:

src/hornet/event.py

 class GraphsReady(Event):
     """Event that indicates that a list of graphs is ready for sharing with
     other plugins. the *data* must be a list or iterator 
-    of :cls:`hornet.network.Graph` objects.
+    of :class:`hornet.network.Graph` objects.
     """
 
 class ProcessingStart(Event):
     
 def is_accepted_event(event, accepted_types):
     """Determines if the *event* is one of the *accepted_types*. *event*
-    should be an instance of :cls:`hornet.event.Event` or instance of a 
-    subclass of :cls:`hornet.event.Event`.  *accepted_types* can be a single
+    should be an instance of :class:`hornet.event.Event` or instance of a 
+    subclass of :class:`hornet.event.Event`.  *accepted_types* can be a single
     class or a tuple of classes.
     
     >>> e = GraphsReady(None)
 
 def graphs_ready(event):
     """Utility method for determining if *event* is a 
-    :cls:`hornet.event.GraphsReady` event.
+    :class:`hornet.event.GraphsReady` event.
     
     >>> e = GraphsReady(None)
     >>> graphs_ready(e)

src/hornet/plugin.py

 def notify_on_finish(func, *args, **kw):
     """Decorator that will notify all the listeners of the the plugin once
     *func* is complete. The notification event, a subclass of 
-    :cls:`hornet.event.Event` must be returned by *func*. 
+    :class:`hornet.event.Event` must be returned by *func*. 
     Expects *func* to be a method of an instance of
-     :class:`hornet.plugin.Plugin`.
+    :class:`hornet.plugin.Plugin`.
     """
     self = args[0]
     event = func(*args, **kw)
         # must be subclassed
     
     def accepted_events(self):
-        """Returns the set of :cls:`hornet.event.Event` subclasses that the
+        """Returns the set of :class:`hornet.event.Event` subclasses that the
         :meth:`hornet.plugin.Plugin.notify` method with accept. The passing of 
         Events of any other type to the notify method could potentially 
         raise an exception.  Can return either a single class or a tuple

src/hornet/release.py

 '''
 author = 'John Paulett'
 author_email = 'john.paulett@vanderbilt.edu'
-copyright = '2008-2009 John Paulett.'
+copyright = '2008-2009 John Paulett'
 url = 'http://hiplab.mc.vanderbilt.edu/projects/hornet/'
 download_url = 'http://hiplab.mc.vanderbilt.edu/projects/hornet/download'
 license = 'Proprietary' 

src/hornet/task.py

 # you should have received as part of this distribution.
 
 """Module for the parallel processing of tasks. Avoids the global interpreter 
-lock, thus allowing a single Python process from taking advantage of 
+lock, thus allowing a single Python process to take advantage of 
 multiple processors. An optimal use is for plugins that can process several
 network graphs in parallel.
 
+:mod:`hornet.task` is a leaky wrapper for :mod:`multiprocessing`.  If using
+Python <2.6, it requires pyprocessing.
+
 >>> f = lambda x: x**x
 >>> p = Pool()              #doctest: +SKIP
 >>> p.map(f, [1, 4, 10])    #doctest: +SKIP
 [1, 16, 100]
 
-:mod:`hornet.task` is a leaky wrapper for :mod:`multiprocessing`.  If using
-Python <2.6, it requires pyprocessing.
 
 """
 try:

src/hornet/util.py

 import operator
 
 class Period(tuple):
+    """Simple data structure representing a period in time with a start and end.
+    This class provides formatting for the period.
+    
+    >>> p = Period(datetime.date(2008, 1, 1), datetime.date(2008, 1, 8))
+    >>> repr(p)
+    '<Period(datetime.date(2008, 1, 1), datetime.date(2008, 1, 8))>'
+    >>> str(p)
+    '20080101-20080108'
+    """
     def __new__(klass, start, end):
         return super(Period, klass).__new__(klass, (start, end))
     
     def __str__(self):
-        return '-'.join([d.strftime('%Y%m%d') for d in self])
+        return '-'.join([d.strftime('%Y%m%d') for d in self]) #TODO handle times
     
     def __repr__(self):
         return '<%s(%s, %s)>' % (str(self.__class__.__name__), repr(self[0]), repr(self[1]))
 def dict_apply(data, value_func):
     """Applies the function *value_func* to every value in the dictionary, 
     *data*. Returns a new copy of the dict, leaving the original unmodified.
+    
+    >>> dict_apply({'a': 1, 'b': 'c'}, lambda x: x * 3)
+    {'a': 3, 'b': 'ccc'}
     """
     temp = ((k, value_func(v)) for k, v in data.iteritems())
     return dict(temp)
     are fairly simple. If a decorator expects a function and
     returns a function (no descriptors), and if it doesn't
     modify function attributes or docstring, then it is
-    eligible to use this. Simply apply @simple_decorator to
+    eligible to use this. Simply apply `@simple_decorator` to
     your decorator and it will automatically preserve the
     docstring and function attributes of functions to which
     it is applied.