Permalink
Browse files

DOC: Improve documentation.

  • Loading branch information...
1 parent 384ad6a commit 47d9c53b3d40c79327312377cec4811c22814270 @GaelVaroquaux GaelVaroquaux committed Aug 31, 2009
Showing with 56 additions and 24 deletions.
  1. BIN doc/documentation.zip
  2. +10 −7 doc/index.rst
  3. +3 −4 doc/memory.rst
  4. +6 −2 joblib/hashing.py
  5. +3 −1 joblib/logger.py
  6. +5 −3 joblib/memory.py
  7. +4 −5 joblib/numpy_pickle.py
  8. +1 −1 setup.cfg
  9. +24 −1 setupegg.py
View
BIN doc/documentation.zip
Binary file not shown.
View
17 doc/index.rst
@@ -12,16 +12,19 @@ Joblib: running Python function as pipeline jobs
Introduction
------------
+
.. automodule:: joblib
+Module contents
+----------------
.. autosummary::
:toctree: generated
-
- joblib.Memory
- joblib.PrintTime
- joblib.Logger
- joblib.hash
- joblib.dump
- joblib.load
+
+ Memory
+ dump
+ load
+ PrintTime
+ Logger
+ hash
View
7 doc/memory.rst
@@ -1,5 +1,7 @@
+.. _memory:
+
==============================
-The `Memory` class
+The `Memory` class
==============================
.. currentmodule:: joblib.memory
@@ -233,9 +235,6 @@ Gotchas
>>> print sin(0)
0.0
-..
- FIXME: Check the above
-
.. _`reference chapter`: http://www.informit.com/articles/article.aspx?p=453682
View
8 joblib/hashing.py
@@ -84,11 +84,15 @@ def save(self, obj):
def hash(obj, hash_name='md5', coerce_mmap=False):
- """
+ """ Quick calculation of a hash to identify uniquely Python objects
+ containing numpy arrays.
+
+
Parameters
-----------
hash_name: 'md5' or 'sha1'
- sha1 is supposedly safer, but md5 is faster.
+ Hashing algorithm used. sha1 is supposedly safer, but md5 is
+ faster.
coerce_mmap: boolean
Make no difference between np.memmap and np.ndarray
"""
View
4 joblib/logger.py
@@ -20,6 +20,8 @@
# class `Logger`
################################################################################
class Logger(object):
+ """ Base class for logging messages.
+ """
def warn(self, msg):
logging.warn("[%s]: %s" % (self, msg))
@@ -30,7 +32,7 @@ def warn(self, msg):
# class `PrintTime`
################################################################################
class PrintTime(object):
- """ An object to print messages while keeping track of time.
+ """ Print and log messages while keeping track of time.
"""
def __init__(self, logfile=None):
View
8 joblib/memory.py
@@ -1,6 +1,6 @@
"""
A context object for caching a function's return value each time it
-are called.
+is called with the same input arguments.
"""
@@ -213,11 +213,13 @@ def __repr__(self):
# class `Memory`
################################################################################
class Memory(Logger):
- """ A context object for caching a function's return value each time
- it are called.
+ """ A context object for caching a function's return value each time it
+ is called with the same input arguments.
All values are cached on the filesystem, in a deep directory
structure.
+
+ see :ref:`memory`
"""
#-------------------------------------------------------------------------
# Public interface
View
9 joblib/numpy_pickle.py
@@ -106,10 +106,8 @@ def load_build(self):
# Utility functions
def dump(value, filename):
- """ Pickles the object (`value`) into the passed filename.
-
- The numpy arrays contained in the object are saved as separate
- .npy files alongside the main pickle file.
+ """ Persist a Python into a filename, with numpy arrays saved as
+ separate .npy files.
"""
try:
pickler = NumpyPickler(filename)
@@ -122,7 +120,8 @@ def dump(value, filename):
def load(filename, mmap_mode=None):
- """ Load the pickled objects from the given file.
+ """ Reconstruct a Python object and the numpy arrays it contains from
+ a persisted file.
This function loads the numpy array files saved separately. If
the mmap_mode argument is given, it is passed to np.save and
View
2 setup.cfg
@@ -4,7 +4,7 @@ release = egg_info -RDb ''
bdist = build_sphinx bdist
sdist = build_sphinx sdist
# Make sure a zip file is created each time we build the sphinx docs
-build_sphinx = build_sphinx zip_help
+build_sphinx = generate_help build_sphinx zip_help
[egg_info]
tag_build = .dev
View
25 setupegg.py
@@ -3,6 +3,7 @@
import zipfile
import os
+import sys
from setuptools import Command
@@ -55,13 +56,35 @@ def initialize_options(self):
def finalize_options(self):
pass
+
+class GenerateHelp(Command):
+ description = " Generate the autosummary files "
+
+ user_options = [
+ ('None', None, 'this command has no options'),
+ ]
+
+ def run(self):
+ os.system('%s doc/sphinxext/autosummary_generate.py -o doc/generated/ doc/*.rst'
+ % sys.executable)
+
+
+ def initialize_options(self):
+ pass
+
+ def finalize_options(self):
+ pass
+
+
+
################################################################################
# Call the setup.py script, injecting the setuptools-specific arguments.
extra_setuptools_args = dict(
tests_require=['nose', 'coverage'],
test_suite='nose.collector',
- cmdclass={'zip_help':ZipHelp},
+ cmdclass={'zip_help':ZipHelp,
+ 'generate_help':GenerateHelp},
zip_safe=False,
)

0 comments on commit 47d9c53

Please sign in to comment.