Skip to content

Commit

Permalink
Rebased with master. Should now work!
Browse files Browse the repository at this point in the history
  • Loading branch information
srikris committed Apr 28, 2016
1 parent 3222417 commit 4ccfd09
Showing 1 changed file with 6 additions and 13 deletions.
19 changes: 6 additions & 13 deletions oss_src/unity/python/sframe/_gl_pickle.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,15 +114,15 @@ def _to_abs_path_set(self, l):
.. sourcecode:: python
from graphlab.util import gl_pickle
import graphlab as gl
import sframe
from sframe import GLPickle
obj = {'foo': gl.SFrame([1,2,3]),
'bar': gl.SArray([1,2,3]),
'foo-bar': ['foo-and-bar', gl.SFrame()]}
# Setup the GLPickler
pickler = gl_pickle.GLPickler(filename = 'foo-bar')
pickler = GLPickler(filename = 'foo-bar')
pickler.dump(obj)
# The pickler has to be closed to make sure the files get closed.
Expand All @@ -132,7 +132,7 @@ def _to_abs_path_set(self, l):
.. sourcecode:: python
unpickler = gl_pickle.GLUnpickler(filename = 'foo-bar')
unpickler = GLUnpickler(filename = 'foo-bar')
obj = unpickler.load()
unpickler.close()
print obj
Expand All @@ -143,14 +143,13 @@ def _to_abs_path_set(self, l):
.. sourcecode:: python
unpickler = gl_pickle.GLUnpickler('foo-bar')
unpickler = GLUnpickler('foo-bar')
obj = unpickler.load()
unpickler.close()
print obj
Notes
--------
-----
The GLC pickler saves the files into single zip archive with the following
file layout.
Expand All @@ -173,8 +172,6 @@ def _to_abs_path_set(self, l):
"gl_archive_dir_N"
"""
def __init__(self, filename, protocol = -1, min_bytes_to_save = 0):
"""
Expand Down Expand Up @@ -335,10 +332,6 @@ def __gl_pickle_load__(cls, filename):
("SGraph", 'sgraph-save-path')
("Model", 'model-save-path')
Note that the key difference between version 1.0 and 2.0 is that 2.0 of
GLPickle is that version 2.0 saves the load_sframe method while 1.0
saves the string name for the class (which was hard-coded in)
References
----------
- Python Pickle Docs(https://docs.python.org/2/library/_pickle.html)
Expand Down

0 comments on commit 4ccfd09

Please sign in to comment.