1. John Paulett


John Paulett  committed 06bc097

Working on getting the documentation current.

  • Participants
  • Parent commits 3b3de1d
  • Branches default

Comments (0)

Files changed (11)

File docs/conf.py

View file
 # 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'

File docs/ref/event.rst

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

File docs/ref/file.rst

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

File docs/ref/index.rst

View file
+    event

File docs/ref/plugin.rst

View file
-.. autofunction:: hornet.plugin.logl
+.. autofunction:: hornet.plugin.log
 .. autofunction:: hornet.plugin.notify_on_finish

File docs/ref/util.rst

View file
 .. testsetup:: *
     from hornet.util import *
+    import datetime
 .. automodule:: hornet.util

File src/hornet/event.py

View file
 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)

File src/hornet/plugin.py

View file
 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

File src/hornet/release.py

View file
 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' 

File src/hornet/task.py

View file
 # 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.

File src/hornet/util.py

View file
 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.