Skip to content

Commit

Permalink
define __all__ variables (#58)
Browse files Browse the repository at this point in the history
  • Loading branch information
svenkreiss committed May 1, 2017
1 parent 75b7f26 commit d27dd99
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 23 deletions.
3 changes: 3 additions & 0 deletions pysparkling/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,6 @@

from . import fileio
from . import streaming

__all__ = ['RDD', 'Context', 'Broadcast', 'StatCounter', 'CacheManager',
'fileio', 'streaming']
30 changes: 7 additions & 23 deletions pysparkling/cache_manager.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
"""
Manages caches of calculated partitions.
"""
"""Manages caches of calculated partitions."""

from __future__ import (division, absolute_import, print_function,
unicode_literals)
Expand All @@ -19,18 +16,10 @@ class CacheManager(object):
When mem_obj or disk_location are None, it means the object does not
exist in memory or on disk. The other variables might be set though.
:param max_mem:
Memory in GB to keep in memory before spilling to disk.
:param serializer:
Use to serialize cache objects.
:param deserializer:
Use to deserialize cache objects.
:param checksum:
Function returning a checksum.
:param max_mem: Memory in GB to keep in memory before spilling to disk.
:param serializer: Use to serialize cache objects.
:param deserializer: Use to deserialize cache objects.
:param checksum: Function returning a checksum.
"""
singleton__ = None

Expand Down Expand Up @@ -92,11 +81,8 @@ def has(self, ident):
def get_not_in(self, idents):
"""get entries not given in idents
:param idents:
A list of cache ids (or idents).
:returns:
All cache entries that are not in the given list.
:param idents: A list of cache ids (or idents).
:returns: All cache entries that are not in the given list.
"""
return {i: c
for i, c in self.cache_obj.items()
Expand All @@ -107,7 +93,6 @@ def join(self, cache_objects):
:param cache_objects:
Objects obtained with :func:`CacheManager.get_not_in()`.
"""
self.cache_obj.update(cache_objects)

Expand All @@ -126,7 +111,6 @@ def clone_contains(self, filter_id):
:returns:
A new CacheManager with the entries that contain partial_ident
in the ident.
"""
cm = CacheManager(self.max_mem,
self.serializer, self.deserializer,
Expand Down
2 changes: 2 additions & 0 deletions pysparkling/fileio/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@

from .file import File
from .textfile import TextFile

__all__ = ['File', 'TextFile']
3 changes: 3 additions & 0 deletions pysparkling/fileio/fs/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
from .s3 import S3


__all__ = ['FileSystem', 'GS', 'Hdfs', 'Http', 'Local', 'S3']


FILE_EXTENSIONS = [
(('file', ''), Local),
(('s3', 's3n'), S3),
Expand Down
2 changes: 2 additions & 0 deletions pysparkling/streaming/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@

from .context import StreamingContext
from .dstream import DStream

__all__ = ['StreamingContext', 'DStream']

0 comments on commit d27dd99

Please sign in to comment.