Permalink
Browse files

STY: PEP8 cleanup.

The only warnings left are for too-long lines in docstrings, and for no spaces
around the "**" operator.
  • Loading branch information...
1 parent 05be47c commit 764d76153e6948df37795a643714e85765a11ca0 @rgommers rgommers committed Aug 24, 2011
View
@@ -2,4 +2,3 @@
This is a phony __init__.py file, so that nose finds the doctests in this
directory.
"""
-
View
@@ -11,7 +11,8 @@
# All configuration values have a default; values that are commented out
# serve to show the default.
-import sys, os
+import sys
+import os
import joblib
@@ -28,7 +29,7 @@
# Add any Sphinx extension module names here, as strings. They can be extensions
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.pngmath', 'numpydoc',
- 'phantom_import', 'autosummary',
+ 'phantom_import', 'autosummary',
'sphinx.ext.coverage']
#extensions = ['sphinx.ext.autodoc', 'sphinx.ext.doctest']
View
@@ -13,15 +13,15 @@
**BSD-licensed**.
- ============================== ==============================================
+ ============================== ============================================
**User documentation**: http://packages.python.org/joblib
-
+
**Download packages**: http://pypi.python.org/pypi/joblib#downloads
-
+
**Source code**: http://github.com/joblib/joblib
**Report issues**: http://github.com/joblib/joblib/issues
- ============================== ==============================================
+ ============================== ============================================
Vision
@@ -36,7 +36,7 @@
over, for instance when prototyping computational-heavy jobs (as in
scientific development), but hand-crafted solution to aleviate this
issue is error-prone and often leads to unreproducible results
-
+
* **Persist to disk transparently**: persisting in an efficient way
arbitrary objects containing large data is hard. In addition,
hand-written persistence does not link easily the file on disk to the
@@ -46,7 +46,7 @@
It strives to address these problems while **leaving your code and your
flow control as unmodified as possible** (no framework, no new
-paradigms).
+paradigms).
Main features
------------------
@@ -75,7 +75,7 @@
>>> c = square(a)
>>> # The above call did not trigger an evaluation
-2) **Embarrassingly parallel helper:** to make is easy to write readable
+2) **Embarrassingly parallel helper:** to make is easy to write readable
parallel code and debug it quickly:
>>> from joblib import Parallel, delayed
@@ -88,10 +88,10 @@
progressively acquire better logging mechanism to help track what
has been ran, and capture I/O easily. In addition, Joblib will
provide a few I/O primitives, to easily define define logging and
- display streams, and provide a way of compiling a report.
+ display streams, and provide a way of compiling a report.
We want to be able to quickly inspect what has been run.
-..
+..
>>> import shutil ; shutil.rmtree('/tmp/joblib/')
"""
@@ -104,4 +104,3 @@
from .hashing import hash
from .numpy_pickle import dump, load
from .parallel import Parallel, delayed, cpu_count
-
View
@@ -2,7 +2,7 @@
Disk management utilities.
"""
-# Author: Gael Varoquaux <gael dot varoquaux at normalesup dot org>
+# Author: Gael Varoquaux <gael dot varoquaux at normalesup dot org>
# Copyright (c) 2010 Gael Varoquaux
# License: BSD Style, 3 clauses.
@@ -12,9 +12,9 @@
import shutil
import time
+
def disk_used(path):
- """ Return the disk usage in a directory.
- """
+ """ Return the disk usage in a directory."""
size = 0
for file in os.listdir(path) + ['.']:
stat = os.stat(os.path.join(path, file))
@@ -23,7 +23,7 @@ def disk_used(path):
else:
# on some platform st_blocks is not available (e.g., Windows)
# approximate by rounding to next multiple of 512
- size += (stat.st_size // 512 + 1) * 512;
+ size += (stat.st_size // 512 + 1) * 512
# We need to convert to int to avoid having longs on some systems (we
# don't want longs to avoid problems we SQLite)
return int(size / 1024.)
@@ -47,9 +47,10 @@ def memstr_to_kbytes(text):
# then retry once. if it still fails, raise the exception
RM_SUBDIRS_RETRY_TIME = 0.1
+
def rm_subdirs(path, onerror=None):
"""Remove all subdirectories in this path.
-
+
The directory indicated by `path` is left in place, and its subdirectories
are erased.
@@ -86,6 +87,7 @@ def rm_subdirs(path, onerror=None):
shutil.rmtree(fullname, False, None)
break
except os.error, err:
- if err_count > 0: raise
+ if err_count > 0:
+ raise
err_count += 1
time.sleep(RM_SUBDIRS_RETRY_TIME)
Oops, something went wrong.

0 comments on commit 764d761

Please sign in to comment.